| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
closes #33
|
|
|
|
|
| |
if external libraries are required, they have to be added after
the object files that require them.
|
|
|
|
|
|
| |
This reverts commit 1a4dc39864ff80c5fb2464b16c4609593c34ae69.
The commit breaks compilation on sabotage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous commit was done with mingw. And it can not be compiled at
first. Gcc told me he can not find libiconv even if i added -liconv into
LDFLAGS.
https://stackoverflow.com/questions/13249610/how-to-use-ldflags-in-makefile
, and i found this article. The original position of LDFLAGS seems to
only be considered at the compiling stage. But what we gonna go through is
the linking stage, which makes -lxxx in LDFLAGS useless.
So i added LDLIBS to the end of line. By the way, -liconv is set by
default for compatibility. And mingw now works well with gettext-tiny.
|
|
|
|
|
|
|
|
|
|
|
| |
follow https://github.com/sabotage-linux/gettext-tiny/issues/27.
According to @awilfox, GNU gettext will install m4 files to aclocal dir.
But gettext-tiny did not. So autoreconf just stops working and complains
that it can not find needed macros.
Suggested by rofl0r, symlinking all m4 files into $(dataroot)/aclocal is
a good idea. Save a little disk space.
|
|
|
|
|
|
|
|
|
|
|
| |
In the Dzongkha translation of GConf 3.2.6, msgfmt aborts because a line
is 4,279 bytes long, while the buffer size is limited to 4,096 bytes.
This commit raises the line buffer size to 8,192 bytes, and also doubles
the conversion buffer to ensure enough space is still present to do the
proper conversions.
Resolves #28.
|
|
|
|
|
|
|
|
| |
Without this, libintl will always be compiled for the default NOOP
flavour, which does not help when you want =MUSL or =NONE.
This tripped us up at Adélie:
https://code.foxkit.us/adelie/packages/commit/5d228c9a
|
|
|
|
|
| |
Failed to compile procps pofiles due to msgfmt did not handle '\a' at
all. Programs stepped in to abort directly.
|
|
|
|
|
|
|
|
|
|
| |
Found when updating neovim.
The original one will try `touch ./...file` when outputdir arg is empty.
But it failed because cmake passed an absolute path to our script. After
my modification, it will still try to touch file in a relative path with a
empty outputdir arg, but wont fail when the outputfile arg is an
absolute path.
|
| |
|
|
|
|
| |
Without double quotes, the non-portable path will fail the execution.
|
|
|
|
|
|
| |
As pointed out in https://github.com/sabotage-linux/gettext-tiny/issues/21
, there're multiple destinations for Makefile.in. We need to figure out
all destinations coded in configure.ac dynamically.
|
| |
|
|
|
|
|
|
|
| |
This commit fixed the bug introduced in the previous commit. ABOUT-NLS
is not affected by `AC_CONFIG_AUX_DIR` option.
Details in https://github.com/sabotage-linux/gettext-tiny/issues/18.
|
|
|
|
|
|
| |
To solve https://github.com/sabotage-linux/gettext-tiny/issues/18,
config.rpath should be placed at the right place asked by configure.ac,
as well as ABOUT-NLS.
|
|
|
|
|
|
|
| |
As discussed with rofl0r, stack allocation is super fast. We could just
make convbuf a local variable, for not to confuse readers. This buffer
is only used in this function, and we dont need to worry about the
performance of repeated allocation.
|
|
|
|
| |
https://github.com/sabotage-linux/gettext-tiny/commit/11e4f3cde9559538e8f35f4dc4f53333b96f3512. As rofl0r said, a global buffer is a bit ugly. I moved it to the struct fiLes. And i missed out that escape() dont need a clean, zero filled buffer at all.
|
|
|
|
|
|
| |
Texts passed to process are unescaped automatically by lib, but what we
need to output is escaped texts. Or msgfmt cant work with them
correctly.
|
|
|
|
|
|
| |
It's obviously wrong that touching files under outputdir, when output
dir is empty. Also, the original code is too complex, it should be done
with less and tidy code.
|
|
|
|
|
|
|
|
|
|
|
| |
This is a similiar issue to the one fixed in msgfmt. When the input is
'-', code stepped in to the fisrt if branch. But, this could either an
option or a '-' after '-o', or even using '-' as the input of po files.
As a result, it did not go into the set_file() function, this arg is
completely ignored.
So, here's the solution: put the handle codes in the first branch, too.
And '-' will never be missing again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when compiling gdk-pixbuf 2.36.11, msgfmt segfaulted because poparser
went though a situation where:
```
msgstr[1] ""
"ssss
"vvvv
```
In case, it extracted the string ' "ssss" ' and see the remaining part ' vvvv '
as the invalid, there's no wrong with the logic itself. But i wonder if we
could just be generous with these merged strings generated by xgettext. If we
insist on correctness everytime po files are updated by xgettext, we may meet
numbers of abort(). Seeing gnu one ignoring these obvious invalid lines, i made
this commit to provide a more smooth user experience.
|
|
|
|
|
|
|
|
| |
https://github.com/sabotage-linux/gettext-tiny/issues/16#issuecomment-342928111
If we dont handle except_in_fn at the end of all other possibilities, we
may take the other flags as input file wrongly. In that case, we
will ignore the codes after that block once, since except_in_fn is
always 1 initially.
|
|
|
|
|
| |
I failed to compile audacity pofiles due to msgfmt did not handle '\b'
at all. Programs stepped in to abort directly.
|
|
|
|
|
|
|
| |
Because some of our tools are just stub implementations, or not a
full-feautured tool, we should always overwrite makefile.in and m4
files to ensure our programs wont die due to the GNU makefile. So
we get a maximum possibility for passing the build.
|
|
|
|
|
|
|
| |
i have a misunderstanding on --update, this argument is used to update
the original .po file. And because we just simply copy strings from
.po file, so we should just return 0, as we dont actually do anything to
.po file. when --update is passed, nothing should be printed on screen.
|
|
|
|
|
|
| |
GNU one does not generate useless 'only HEADER' file when input is
empty, which is cleaner and reasonable in my view. I decided to do the
same thing.
|
|
|
|
|
| |
I noticed GNU msgfmt did not fail when i did not specific a output file,
so i decided to write the output to "messages.mo" like GNU one.
|
|
|
|
|
|
|
|
|
|
| |
Prepare for the next commit.
1. Using except_out_fn flag is a little complex, we could just get the
filename by 'arg++ && A'.
2. i previously check except_in_fn in the block 'if (A[0] == '-')' to
prevent ignoring the input file named '-..'. Again, i add similiar codes
to 'A[1] == '-'' to prevent ignoring file named '--...'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/sabotage-linux/gettext-tiny/issues/16
Generally speaking, `-l XX -d po --language` is passed to msgfmt to
generate catalog, only one standalone parameter does not make sense. As catalog has been replaced by gettext, we just
stub it.
Here're the changes to stub these three arguments:
1. -l is followed by a language idetifier, and for -d, it's followed by
a directory, which is used to place the generated catalog files.
2. When passed `--language`, like `msgfmt --tcl...`, we cant specific
-o at the same time. Gnu error: `msgfmt: --tcl and --output-file are mutually exclusive
.` That means there should be no output on terminal but that `-d` despite the input file.
Dont check if they're passed at the same time, as the case using `--language` is very
rare, no translators are using it, but autobuild scripts, scripts only
pass the correct combination.
|
|
|
|
| |
since it is not fatal anymore.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
following https://github.com/sabotage-linux/gettext-tiny/issues/14,
because there're programs using msgmerge --update, abort may break the
build.
As our goal is not to provide these utils of translators, we assume
that nobody would actually make use of these utils. We just provide a
stub to pass the build safely.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
https://github.com/sabotage-linux/gettext-tiny/issues/14.
At line:439, writestr() is called to write down those strings that
have not been wrote down in the main loop.
When po files are empty, nothing is wrote down, so d->plurals_count ==
0. Then, deleting 'invalid' codes in writestr() was executed wrongly.
-1 is not a valid index, qsort will segfault, of course.
To fix the bug, we check d->num[pe_msgid]>0, so it will do nothing when
the files are empty.
|
| |
| |
| |
| |
| |
| | |
to make the code more clear. as rofl0r said, it's hard to understand
what the code is doing without some 'tips'. now it should be clear
enough that what these vars are for.
|
|\ \
| |/
|/| |
support auto generation of po Makefile
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
following https://github.com/sabotage-linux/gettext-tiny/issues/12
as said in the previous commit, the gnu makefile does not work. So,
here, i delete all actions like updating po files by POT, refresh
files...etc. I kicked all stuff out of Makefile, except building .po
files and installing .mo files. The original file installation logic is
kept, either, for not to damage the eco system of autotools. Issue is
completely solved after these three commits.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
following https://github.com/sabotage-linux/gettext-tiny/issues/12
this for supporting auto generation of po Makefile. Softwares may not
write their own Makefile.in for po/* at all. Instead, they depend on
autotools to generate Makefile. And the template makefile.in.in comes
from autopoint.
But the gnu one does not suite gettext-tiny, since xgettext and msgmerge
both are stubs. So, this commit did not work, and it may cause error,
DO NOT USE! A suitable version is to be added in the next commit.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
following https://github.com/sabotage-linux/gettext-tiny/issues/12
this is the first part of the solution the issue, to prepare for
introducing Makefile.in.in in the next commit.
we modify m4dir to datadir, as we will introduce Makefile.in.in, which
should be copied to $datadir$/gettety-tiny. It's a better name. Also
moving m4 to a subdir makes a cleaner structure and a good place to
place Makefile.in.in.
|
|
|
|
|
| |
when compiling tilda, the stub Makefile lacks `install:`, which is
causing errors, this is a quick fix
|
|
|
|
| |
made by rofl0r
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As rofl0r suggested, libintl.a now comes in two flavours, no-op or musl,
or we could just disable it.
no-op: gettext functions just return the input string as translation and
symbols help to get past configure scripts
musl: symbols as in no-op, with libintl built-in in to recent musl
version
Use LIBINTL=FLAVOR, FLAVOR can be NOOP(no-op), MUSL, NONE(disable)
|
|
|
|
|
|
|
| |
found when compiling git/vi.po
writestr() was executed twice due to depend on the wrong flag, this
could be fixed by checking 'i'. 'i' will be 0 for at least and only
one time which is suitable in case.
|
|
|
|
| |
In ki18n/cy-ver, fuzzy appeared just at the first several lines, which is making msgfmt see header as 'the obsolete'.
|
|
|
|
|
| |
Offset caculation is not only complex, but also unreliable. It's hard to say what would happened when it meets an unexpected situation.
Now, writemsg() at the end, so we only need to consider d.len[], quite simpler, faster and safer than before.
|
|
|
|
| |
follow commit https://github.com/sabotage-linux/gettext-tiny/commit/b49e68b34d5fb5ee328bca43d98655ec4c7f25e6, correct the code
|
|
|
|
| |
since i reconstructed the code last time(switch to writemsg()/writelstr()), it wont delete the invalid msgid/str anymore, the original code doesnt make sense. here's the new code, which could work well with writemsg()/writestr().
|
|
|
|
|
|
| |
found when compiling dnsmasq
we can't fseek in stdin, we can only read it for one time
so now i write them to a temporary file first instead
|
|
|
|
|
| |
failed compiling ki18n due to the static size msgstrbuf[8120]
so, we now malloc dynamic buffer, and two asserts make sure safe
|
|
|
|
|
|
|
|
| |
with rtype in compiling of glib, a hidden bug was found
excepted: swith(msgstr, ctxt) == la_proc
reality: swith(msgstr, ctxt) == la_abort
the wrong rule was introduced in https://github.com/sabotage-linux/gettext-tiny/commit/d1bd158eb7463967ab3dd9a862e14d114523d37b
|