| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
since it is not fatal anymore.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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
|
|
|
|
| |
follow https://github.com/sabotage-linux/gettext-tiny/commit/7409501c4cdd4c8d89e6898405816c636a129dc7#commitcomment-22212741
|
|
|
|
|
|
|
| |
here the input, msgid foo; #xxx ; msgid foo2
exception: switch(msgid, msgid) == abort
reality: after go through #xxx, it's now switch(invalid, msgid) == la_incr
so one more value, prev_rtype is here to fix the issue
|
| |
|
|
|
|
| |
though num[str] is allowed to be a little smaller than the maxium value, but it's not allowd to be smaller than num[msgid], which is the minimum value
|
|
|
|
| |
do not assign 0 to nplurals, since it's used as a divisor, avoid arithmetical exceptions
|
|
|
|
|
| |
it's pure number now instead of one in ascii, 50 -> 2. i forgot to
change this when i decided to translate nplurals in ascii to pure number.
|
|\
| |
| | |
some improvements to make it a real alternative to gnu msgfmt
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
with plurals allowed <= nplurals, we can not check it accurately(!=).
But it's impossible that str > the excepted maximum
|
| |
| |
| |
| |
| | |
when msgstr is empty, it's invalid. dinvalid() will delete the invalid
or write them down.
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
as discussed in bc018ee9d4483df17c45953809715df28f3b934b, configure
scripts check for "GNU" by running `msgfmt --statistics /dev/null`.
in our previous fix we changed --statistics from merely being ignored
to just return 0, however that breaks when it is used together with
other options during normal use, like:
msgfmt -c --statistics --verbose -o de.gmo de.po
as done by GNU coreutils.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the .mo format was designed in a way such that all application
can used a single shared non-mutable copy of the translation strings
in memory.
years later an issue was identified with format string specifier macros
that differ between platforms (like PRIu64) and a new
syntax introduced: %<PRIuMAX>.
this however breaks the non-mutable aspect of the .mo files, since now
every application has to remap a modified copy of the strings containing
these "sysdep" format specifiers.
we simply replace these with all possible expanded values of such a macro
directly in the generated .mo file.
|
|
|
|
|
|
|
| |
closes #6
unfortunately the fail-safe design had to be sacrified, to effectively
sort the string table we need to allocate dynamic memory.
|
|
|
|
|
|
|
|
| |
gnulib git, rev 4084b3a git://git.sv.gnu.org/gnulib.git
gnulib git seems to be original source this stuff comes from.
had to update because the existing m4 files had some incompatibility
with latest gnu autotools when trying to build nano from git.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
po.m4 from gnulib/gettext uses a check that this option is supported
in order to exclude the FreeBSD implementation, and force the GNU version
on them.
http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/m4/po.m4?id=d9cfbdfecb502b70c55e594bc897c217ac082f5f#n37
it does so since several years, so it's funny we haven't hit that earlier.
however this now triggers for "deadbeef" in version 0.7.2.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
all autoconf packages that use gnu gettext for translations require
a tool called autopoint in order to run `autoreconf -i`, which is
the command to generate the configure script from configure.ac.
this is often needed to compile git checkouts of applications, because
they usually do not have the configure scripts and the other generated
files checked into their version control systems.
the autopoint tool is called without parameters, and it is required to
copy some m4 files into place and generate some other files.
this version here was created just by observing which error messages
would be thrown after running it and gradually adding functionality.
it was tested on a git checkout of weechat, and later on the source
tarballs of various packages like glib, and it seemed to work so far.
it's very likely that in future new scenarios will show up that require
additional files, but what we have right now is a good start.
the m4 files were taken from gnu gettext 0.18, and they are all licensed
under very liberal conditions. each file has the original copyright header.
there's only one m4 file i wrote myself, which is configheader.m4,
supplying a macro i couldn't otherwise find in gettext's source code.
|
| |
|
|
|
|
|
|
|
| |
if the outputfile is given, but no outputdir specified, we shall not
prefix the outputfilename with `./`.
experienced during the build of weechat 1.6.
|