[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gettext-0.10.35, couple of issues
From: |
Gisli Ottarsson |
Subject: |
gettext-0.10.35, couple of issues |
Date: |
Tue, 23 Jan 2001 00:14:33 -0500 |
I have experienced two issues with gettext-0.10.35 which I would like
to report.
1) Would it not be possible for msgfmt to assist the user in catching
translation bugs, when the translator has incorrectly juxtaposed the
format parameters? This has happened in the following example
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2001-01-20 23:40-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
#: t1.c:21
msgid "Integer %d before the float %e\n"
msgstr "Yo buss dis. Float %1$e aftuh de integer %2$d. Sheeit!\n"
Here, the translator intended to first cite the float, which is
the second argument in the argument list and should have written
%2$e. msgfmt does not complain about this detectable error.
2) The usage info for xgettext sez:
-k, --keyword[=WORD] additonal keyword to be looked for (without
WORD means not to use default keywords)
This is a very useful option, which I would like to use in the
following example, to select AsMsg as a keyword, while suppressing
gettext as a keyword.
/* foobar.c */
main()
{
char a=gettext("foo");
char b=AsMsg("bar");
}
There are a couple of problems.
a) If the program is run with the default keywords suppressed, without
proposing
new keywords, the program segfaults.
~/Study/gettext > gdb ../gettext-0.10.35/src/xgettext
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run -k foobar.c
Starting program: /home/gisli/Study/gettext/../gettext-0.10.35/src/xgettext -k
foobar.c
Program received signal SIGSEGV, Segmentation fault.
0x804cc3e in string_list_member (slp=0x0, s=0x80563a0 "main") at str-list.c:142
142 for (j = 0; j < slp->nitems; ++j)
(gdb) where
#0 0x804cc3e in string_list_member (slp=0x0, s=0x80563a0 "main")
at str-list.c:142
#1 0x804dec3 in xgettext_lex (tp=0xbffff750) at xget-lex.c:1222
#2 0x804edfc in scan_c_file (filename=0x8056150 "foobar.c", mlp=0x8056160,
is_cpp_file=0) at xgettext.c:865
#3 0x804fba3 in scanner_c (filename=0x8056150 "foobar.c", mlp=0x8056160)
at xgettext.c:1300
#4 0x804e82a in main (argc=3, argv=0xbffff864) at xgettext.c:509
#5 0x40042e51 in __libc_start_main (main=0x804e04c <main>, argc=3,
ubp_av=0xbffff864, init=0x8048f78 <_init>, fini=0x8051c2c <_fini>,
rtld_fini=0x4000e264 <_dl_fini>, stack_end=0xbffff85c)
at ../sysdeps/generic/libc-start.c:111
b) When I try to use the -k and --keyword options I get confusing behavior:
I try:
% xgettext -k=AsMsg foobar.c # only gettext is found
% xgettext --keyword=AsMsg foobar.c # gettext and AsMsg are found, OK
% xgettext -k= -k=AsMsg foobar.c # gettext keyword not suppressed
% xgettext --keyword= --keyword=AsMsg foobar.c # same problem
Finally, I tried to mix the -k and --keyword options:
% xgettext -k --keyword=AsMsg foobar.c
which had the desired effect.
Thanks a lot for your efforts.
Gisli Ottarsson
- gettext-0.10.35, couple of issues,
Gisli Ottarsson <=