* gettext util
@ 2010-03-19 23:56 Carles Pina i Estany
2010-03-26 16:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-19 23:56 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]
Hello,
Last January I asked for ok to commit this to trunk:
http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00373.html
I've redone the patch (some offsets, Changelog, I removed the
translation of two lines talking about glyphs that we said that was not
needed I think). See the attached patch.
Do I commit?
I cannot remember if with this patch was absolutely everything
gettextizzed in utils, I'll review when it's done. I have the feeling
that I left something that may require some discussion.
Thanks,
--
Carles Pina i Estany
http://pinux.info
[-- Attachment #2: gettext_util2.patch --]
[-- Type: text/x-diff, Size: 16661 bytes --]
=== modified file 'ChangeLog'
--- ChangeLog 2010-03-19 11:28:05 +0000
+++ ChangeLog 2010-03-19 23:53:38 +0000
@@ -1,3 +1,19 @@
+2010-03-19 Carles Pina i Estany <carles@pina.cat>
+
+ * util/grub-editenv.c: Gettextizze mainly all user interface strings
+ excepting grub_util_info or grub_util_error.
+ * util/grub-emu.c: Likewise.
+ * util/grub-fstest.c: Likewise.
+ * util/grub-macho2img.c: Likewise.
+ * util/grub-mkdevicemap.c: Likewise.
+ * util/grub-mkfont.c: Likewise.
+ * util/grub-mkpasswd-pbkdf2.c: Likewise.
+ * util/grub-mkrelpath.c: Likewise.
+ * util/grub-pe2elf.c: Likewise.
+ * util/grub-probe.c: Likewise.
+ * util/grub-script-check.c: Likewise.
+ * po/POTFILES: Add gettextizzed files.
+
2010-03-19 Colin Watson <cjwatson@ubuntu.com>
* .bzrignore: Add gentrigtables, grub-script-check,
=== modified file 'po/POTFILES'
--- po/POTFILES 2010-01-21 08:04:49 +0000
+++ po/POTFILES 2010-03-19 23:46:01 +0000
@@ -77,5 +77,17 @@ normal/misc.c
term/serial.c
+util/grub-editenv.c
+util/grub-emu.c
+util/grub-fstest.c
+util/grub-macho2img.c
+util/grub-mkdevicemap.c
+util/grub-mkfont.c
+util/grub-mkpasswd-pbkdf2.c
util/grub-mkrawimage.c
+util/grub-mkrelpath.c
+util/grub-pe2elf.c
+util/grub-probe.c
+util/grub-probe.c
+util/grub-script-check.c
util/i386/pc/grub-setup.c
=== modified file 'util/grub-editenv.c'
--- util/grub-editenv.c 2010-01-16 00:39:14 +0000
+++ util/grub-editenv.c 2010-03-19 23:46:01 +0000
@@ -69,9 +69,9 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS] [FILENAME] COMMAND\n\
\n\
Tool to edit environment block.\n\
@@ -87,7 +87,7 @@ Tool to edit environment block.\n\
\n\
If not given explicitly, FILENAME defaults to %s.\n\
\n\
-Report bugs to <%s>.\n",
+Report bugs to <%s>.\n"),
program_name, DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG, PACKAGE_BUGREPORT);
exit (status);
@@ -287,7 +287,7 @@ main (int argc, char *argv[])
/* Obtain the filename. */
if (optind >= argc)
{
- fprintf (stderr, "no filename specified\n");
+ fprintf (stderr, _("no filename specified\n"));
usage (1);
}
@@ -312,7 +312,7 @@ main (int argc, char *argv[])
unset_variables (filename, argc - optind - 2, argv + optind + 2);
else
{
- fprintf (stderr, "unknown command %s\n", command);
+ fprintf (stderr, _("unknown command %s\n"), command);
usage (1);
}
=== modified file 'util/grub-emu.c'
--- util/grub-emu.c 2010-02-07 16:30:16 +0000
+++ util/grub-emu.c 2010-03-19 23:46:01 +0000
@@ -126,10 +126,10 @@ usage (int status)
{
if (status)
fprintf (stderr,
- "Try `%s --help' for more information.\n", program_name);
+ _("Try `%s --help' for more information.\n"), program_name);
else
printf (
- "Usage: %s [OPTION]...\n"
+ _("Usage: %s [OPTION]...\n"
"\n"
"GRUB emulator.\n"
"\n"
@@ -141,7 +141,7 @@ usage (int status)
" -h, --help display this message and exit\n"
" -V, --version print version information and exit\n"
"\n"
- "Report bugs to <%s>.\n", program_name, DEFAULT_DEVICE_MAP, DEFAULT_DIRECTORY, PACKAGE_BUGREPORT);
+ "Report bugs to <%s>.\n"), program_name, DEFAULT_DEVICE_MAP, DEFAULT_DIRECTORY, PACKAGE_BUGREPORT);
return status;
}
\f
@@ -191,13 +191,13 @@ main (int argc, char *argv[])
if (optind < argc)
{
- fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind]);
+ fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind]);
return usage (1);
}
/* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */
if (hold && verbosity > 0)
- printf ("Run \"gdb %s %d\", and set ARGS.HOLD to zero.\n",
+ printf (_("Run \"gdb %s %d\", and set ARGS.HOLD to zero.\n"),
program_name, (int) getpid ());
while (hold)
{
=== modified file 'util/grub-fstest.c'
--- util/grub-fstest.c 2010-01-27 01:49:11 +0000
+++ util/grub-fstest.c 2010-03-19 23:46:01 +0000
@@ -366,9 +366,9 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... IMAGE_PATH COMMANDS\n\
\n\
Debug tool for filesystem driver.\n\
@@ -389,7 +389,7 @@ Debug tool for filesystem driver.\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@@ -480,7 +480,7 @@ main (int argc, char *argv[])
/* Obtain PATH. */
if (optind + num_disks - 1 >= argc)
{
- fprintf (stderr, "Not enough pathname.\n");
+ fprintf (stderr, _("Not enough pathname.\n"));
usage (1);
}
@@ -488,7 +488,7 @@ main (int argc, char *argv[])
for (i = 0; i < num_disks; i++, optind++)
if (argv[optind][0] != '/')
{
- fprintf (stderr, "Must use absolute path.\n");
+ fprintf (stderr, _("Must use absolute path.\n"));
usage (1);
}
@@ -528,13 +528,13 @@ main (int argc, char *argv[])
}
else
{
- fprintf (stderr, "Invalid command %s.\n", argv[optind]);
+ fprintf (stderr, _("Invalid command %s.\n"), argv[optind]);
usage (1);
}
if (optind + 1 + nparm > argc)
{
- fprintf (stderr, "Invalid parameter for command %s.\n",
+ fprintf (stderr, _("Invalid parameter for command %s.\n"),
argv[optind]);
usage (1);
}
@@ -543,7 +543,7 @@ main (int argc, char *argv[])
}
else
{
- fprintf (stderr, "No command is specified.\n");
+ fprintf (stderr, _("No command is specified.\n"));
usage (1);
}
=== modified file 'util/grub-macho2img.c'
--- util/grub-macho2img.c 2009-06-10 21:04:23 +0000
+++ util/grub-macho2img.c 2010-03-19 23:46:01 +0000
@@ -44,21 +44,21 @@ main (int argc, char **argv)
do_bss = 1;
if (argc < 2 + do_bss)
{
- printf ("Usage: %s [--bss] filename.exec filename.img\n"
- "Convert Mach-O into raw image\n", argv[0]);
+ printf (_("Usage: %s [--bss] filename.exec filename.img\n"
+ "Convert Mach-O into raw image\n"), argv[0]);
return 0;
}
in = fopen (argv[1 + do_bss], "rb");
if (! in)
{
- printf ("Couldn't open %s\n", argv[1 + do_bss]);
+ printf (_("Couldn't open %s\n"), argv[1 + do_bss]);
return 1;
}
out = fopen (argv[2 + do_bss], "wb");
if (! out)
{
fclose (in);
- printf ("Couldn't open %s\n", argv[2 + do_bss]);
+ printf (_("Couldn't open %s\n"), argv[2 + do_bss]);
return 2;
}
fseek (in, 0, SEEK_END);
@@ -69,7 +69,7 @@ main (int argc, char **argv)
{
fclose (in);
fclose (out);
- printf ("Couldn't allocate buffer\n");
+ printf (_("Couldn't allocate buffer\n"));
return 3;
}
fread (buf, 1, bufsize, in);
@@ -79,7 +79,7 @@ main (int argc, char **argv)
fclose (in);
fclose (out);
free (buf);
- printf ("Invalid Mach-O fle\n");
+ printf (_("Invalid Mach-O fle\n"));
return 4;
}
curcmd = (struct grub_macho_segment32 *) (buf + sizeof (*head));
@@ -111,6 +111,6 @@ main (int argc, char **argv)
}
fclose (in);
fclose (out);
- printf("macho2img complete\n");
+ printf(_("macho2img complete\n"));
return 0;
}
=== modified file 'util/grub-mkdevicemap.c'
--- util/grub-mkdevicemap.c 2010-01-16 00:26:52 +0000
+++ util/grub-mkdevicemap.c 2010-03-19 23:46:01 +0000
@@ -84,9 +84,9 @@ usage (int status)
{
if (status)
fprintf (stderr,
- "Try `%s --help' for more information.\n", program_name);
+ _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTION]...\n\
\n\
Generate a device map file automatically.\n\
@@ -98,8 +98,7 @@ Generate a device map file automatically
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
-Report bugs to <%s>.\n\
-", program_name,
+Report bugs to <%s>.\n"), program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
=== modified file 'util/grub-mkfont.c'
--- util/grub-mkfont.c 2010-01-26 20:16:08 +0000
+++ util/grub-mkfont.c 2010-03-19 23:52:17 +0000
@@ -104,9 +104,9 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS] FONT_FILES\n\
\nOptions:\n\
-o, --output=FILE_NAME set output file name\n\
@@ -125,7 +125,7 @@ Usage: %s [OPTIONS] FONT_FILES\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@@ -461,11 +461,11 @@ write_font_pf2 (struct grub_font_info *f
if (font_verbosity > 0)
{
- printf ("Font name: %s\n", font_name);
- printf ("Max width: %d\n", font_info->max_width);
- printf ("Max height: %d\n", font_info->max_height);
- printf ("Font ascent: %d\n", font_info->asce);
- printf ("Font descent: %d\n", font_info->desc);
+ printf (_("Font name: %s\n"), font_name);
+ printf (_("Max width: %d\n"), font_info->max_width);
+ printf (_("Max height: %d\n"), font_info->max_height);
+ printf (_("Font ascent: %d\n"), font_info->asce);
+ printf (_("Font descent: %d\n"), font_info->desc);
}
num = 0;
@@ -485,7 +485,7 @@ write_font_pf2 (struct grub_font_info *f
font_info->glyph = pre;
if (font_verbosity > 0)
- printf ("Number of glyph: %d\n", num);
+ printf (_("Number of glyph: %d\n"), num);
leng = grub_cpu_to_be32 (num * 9);
grub_util_write_image (FONT_FORMAT_SECTION_NAMES_CHAR_INDEX,
=== modified file 'util/grub-mkpasswd-pbkdf2.c'
--- util/grub-mkpasswd-pbkdf2.c 2010-01-20 06:36:17 +0000
+++ util/grub-mkpasswd-pbkdf2.c 2010-03-19 23:46:01 +0000
@@ -74,16 +74,16 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS]\n\
\nOptions:\n\
-c number, --iteration-count=number Number of PBKDF2 iterations\n\
-l number, --buflen=number Length of generated hash\n\
-s number, --salt=number Length of salt\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
else
tty_changed = 0;
- printf ("Enter password: ");
+ printf (_("Enter password: "));
pass1 = NULL;
{
grub_size_t n;
@@ -230,7 +230,7 @@ main (int argc, char *argv[])
if (nr >= 1 && pass1[nr-1] == '\n')
pass1[nr-1] = 0;
- printf ("\nReenter password: ");
+ printf (_("\nReenter password: "));
pass2 = NULL;
{
grub_size_t n;
@@ -327,7 +327,7 @@ main (int argc, char *argv[])
hexify (bufhex, buf, buflen);
hexify (salthex, salt, saltlen);
- printf ("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n", c, salthex, bufhex);
+ printf (_("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n"), c, salthex, bufhex);
memset (buf, 0, buflen);
memset (bufhex, 0, 2 * buflen);
free (buf);
=== modified file 'util/grub-mkrelpath.c'
--- util/grub-mkrelpath.c 2010-01-16 00:26:52 +0000
+++ util/grub-mkrelpath.c 2010-03-19 23:46:01 +0000
@@ -34,9 +34,9 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS] PATH\n\
\n\
Make a system path relative to it's root.\n\
@@ -45,7 +45,7 @@ Options:\n\
-h, --help display this message and exit\n\
-V, --version print version information and exit\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@@ -85,13 +85,13 @@ main (int argc, char *argv[])
if (optind >= argc)
{
- fprintf (stderr, "No path is specified.\n");
+ fprintf (stderr, _("No path is specified.\n"));
usage (1);
}
if (optind + 1 != argc)
{
- fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
+ fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind + 1]);
usage (1);
}
=== modified file 'util/grub-pe2elf.c'
--- util/grub-pe2elf.c 2010-03-04 15:25:26 +0000
+++ util/grub-pe2elf.c 2010-03-19 23:46:01 +0000
@@ -42,9 +42,9 @@ static void
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS] input [output]\n\
\n\
Tool to convert pe image to elf.\n\
@@ -53,7 +53,7 @@ Tool to convert pe image to elf.\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
@@ -502,7 +502,7 @@ main (int argc, char *argv[])
/* Obtain PATH. */
if (optind >= argc)
{
- fprintf (stderr, "Filename not specified.\n");
+ fprintf (stderr, _("Filename not specified.\n"));
usage (1);
}
=== modified file 'util/grub-probe.c'
--- util/grub-probe.c 2010-01-20 02:11:07 +0000
+++ util/grub-probe.c 2010-03-19 23:46:01 +0000
@@ -314,9 +314,9 @@ usage (int status)
{
if (status)
fprintf (stderr,
- "Try `%s --help' for more information.\n", program_name);
+ _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... [PATH|DEVICE]\n\
\n\
Probe device information for a given path (or device, if the -d option is given).\n\
@@ -330,7 +330,7 @@ Probe device information for a given pat
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
-", program_name,
+"), program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
@@ -408,13 +408,13 @@ main (int argc, char *argv[])
/* Obtain ARGUMENT. */
if (optind >= argc)
{
- fprintf (stderr, "No path or device is specified.\n");
+ fprintf (stderr, _("No path or device is specified.\n"));
usage (1);
}
if (optind + 1 != argc)
{
- fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
+ fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind + 1]);
usage (1);
}
=== modified file 'util/grub-script-check.c'
--- util/grub-script-check.c 2010-03-14 16:50:55 +0000
+++ util/grub-script-check.c 2010-03-19 23:46:01 +0000
@@ -109,9 +109,9 @@ usage (int status)
{
if (status)
fprintf (stderr,
- "Try ``%s --help'' for more information.\n", program_name);
+ _("Try ``%s --help'' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [PATH]\n\
\n\
Checks GRUB script configuration file for syntax errors.\n\
@@ -120,8 +120,7 @@ Checks GRUB script configuration file fo
-V, --version print version information and exit\n\
-v, --verbose print script being processed\n\
\n\
-Report bugs to <%s>.\n\
-", program_name,
+Report bugs to <%s>.\n"), program_name,
PACKAGE_BUGREPORT);
exit (status);
}
@@ -212,7 +211,7 @@ main (int argc, char *argv[])
}
else if (optind + 1 != argc)
{
- fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
+ fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind + 1]);
usage (1);
}
else
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-19 23:56 gettext util Carles Pina i Estany
@ 2010-03-26 16:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-03-27 0:54 ` Carles Pina i Estany
0 siblings, 1 reply; 11+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-03-26 16:00 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]
Carles Pina i Estany wrote:
> Hello,
>
> Last January I asked for ok to commit this to trunk:
> http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00373.html
>
> I've redone the patch (some offsets, Changelog, I removed the
> translation of two lines talking about glyphs that we said that was not
> needed I think). See the attached patch.
>
> Do I commit?
>
According to gettext manual usage messages must be internationalised on
per-option basis to allow reuse of e.g. --help desciption and to avoid
the whole big message to be marked as fuzzy if only one option changes.
Another problem is unclear or ayabtu sentences. "Not enough pathname" is
surely one of them. Can a native English speaker review this part?
> I cannot remember if with this patch was absolutely everything
> gettextizzed in utils, I'll review when it's done. I have the feeling
> that I left something that may require some discussion.
>
> Thanks,
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-26 16:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-03-27 0:54 ` Carles Pina i Estany
2010-03-27 0:59 ` Carles Pina i Estany
2010-03-27 11:29 ` Jordi Mallach
0 siblings, 2 replies; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-27 0:54 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: jordi
Hello,
On Mar/26/2010, Vladimir '??-coder/phcoder' Serbinenko wrote:
> Carles Pina i Estany wrote:
> > Hello,
> >
> > Last January I asked for ok to commit this to trunk:
> > http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00373.html
> >
> > I've redone the patch (some offsets, Changelog, I removed the
> > translation of two lines talking about glyphs that we said that was not
> > needed I think). See the attached patch.
> >
> > Do I commit?
> >
> According to gettext manual usage messages must be internationalised on
> per-option basis to allow reuse of e.g. --help desciption and to avoid
> the whole big message to be marked as fuzzy if only one option changes.
I'm surprised, specially because if I get the gettext project as a
reference:
http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/src/gettext.c?id=c81a5234a673f6fbc0f8b7ea8f18ef73021b0a2e#n252
They are not doing. Other projects that I can remember where my LUG has
done things (e.g. tar) is not done in this way.
I don't have any probem to change in Grub, I just wonder if people is
expecting it :-/
I'm adding Jordi Mallach to the CC
> Another problem is unclear or ayabtu sentences. "Not enough pathname" is
> surely one of them. Can a native English speaker review this part?
I'll try to review it. Have you spotted some other one?
Cheers,
--
Carles Pina i Estany
http://pinux.info
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 0:54 ` Carles Pina i Estany
@ 2010-03-27 0:59 ` Carles Pina i Estany
2010-03-27 11:29 ` Jordi Mallach
1 sibling, 0 replies; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-27 0:59 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: jordi
Hi,
On Mar/27/2010, Carles Pina i Estany wrote:
> > According to gettext manual usage messages must be internationalised on
> > per-option basis to allow reuse of e.g. --help desciption and to avoid
> > the whole big message to be marked as fuzzy if only one option changes.
>
> I'm surprised, specially because if I get the gettext project as a
> reference:
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/src/gettext.c?id=c81a5234a673f6fbc0f8b7ea8f18ef73021b0a2e#n252
>
> They are not doing. Other projects that I can remember where my LUG has
> done things (e.g. tar) is not done in this way.
not doing it has another problem: alignment.
Certainly, not doing it has the problem that you have spotted (changing
one option will mark everything has fuzzy).
Just I wanted to point to it.
--
Carles Pina i Estany
http://pinux.info
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 0:54 ` Carles Pina i Estany
2010-03-27 0:59 ` Carles Pina i Estany
@ 2010-03-27 11:29 ` Jordi Mallach
2010-03-27 21:42 ` Carles Pina i Estany
1 sibling, 1 reply; 11+ messages in thread
From: Jordi Mallach @ 2010-03-27 11:29 UTC (permalink / raw)
To: grub-devel
Hi Carles,
On Sat, Mar 27, 2010 at 12:54:16AM +0000, Carles Pina i Estany wrote:
> > According to gettext manual usage messages must be internationalised on
> > per-option basis to allow reuse of e.g. --help desciption and to avoid
> > the whole big message to be marked as fuzzy if only one option changes.
>
> I'm surprised, specially because if I get the gettext project as a
> reference:
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/src/gettext.c?id=c81a5234a673f6fbc0f8b7ea8f18ef73021b0a2e#n252
>
> They are not doing. Other projects that I can remember where my LUG has
> done things (e.g. tar) is not done in this way.
>
> I don't have any probem to change in Grub, I just wonder if people is
> expecting it :-/
>
> I'm adding Jordi Mallach to the CC
Whether gettext itself is doing it or not, I'll stick to my experience.
As a translator, I am *really* fed up of trying to fish in a huge help
output to find a tiny change that made the whole string fuzzy and so on.
This is now less of a problem with the tools that support showing the
"previous" string (#|), but it's a huge pain nevertheless.
If you want to make translator's life easier, I'd totally go with
per option messages. If alignment is a problem (how?), I guess translation
comments could be useful to describe how the translated string should look
like.
I assume you mean:
--help Show this help string.
--eggs Get two eggs from the fridge, crack them
and put them on hot olive oil.
It'd be difficult to align "Show" with "Get". I'd say that this depends a
lot on the editor you use. Emacs at least makes it easy to calculate if
you got it right or wrong.
Jordi
--
Jordi Mallach Pérez -- Debian developer http://www.debian.org/
jordi@sindominio.net jordi@debian.org http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 11:29 ` Jordi Mallach
@ 2010-03-27 21:42 ` Carles Pina i Estany
2010-03-27 22:20 ` Colin Watson
2010-03-28 12:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 2 replies; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-27 21:42 UTC (permalink / raw)
To: The development of GNU GRUB
Hi,
On Mar/27/2010, Jordi Mallach wrote:
> On Sat, Mar 27, 2010 at 12:54:16AM +0000, Carles Pina i Estany wrote:
> > > According to gettext manual usage messages must be internationalised on
> > > per-option basis to allow reuse of e.g. --help desciption and to avoid
> > > the whole big message to be marked as fuzzy if only one option changes.
> >
> > I'm surprised, specially because if I get the gettext project as a
> > reference:
> > http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/src/gettext.c?id=c81a5234a673f6fbc0f8b7ea8f18ef73021b0a2e#n252
> >
> > They are not doing. Other projects that I can remember where my LUG has
> > done things (e.g. tar) is not done in this way.
> >
> > I don't have any probem to change in Grub, I just wonder if people is
> > expecting it :-/
> >
> > I'm adding Jordi Mallach to the CC
>
> Whether gettext itself is doing it or not, I'll stick to my
> experience. As a translator, I am *really* fed up of trying to fish
> in a huge help output to find a tiny change that made the whole string
> fuzzy and so on.
These changes doesn't happen often
> This is now less of a problem with the tools that support showing the
> "previous" string (#|), but it's a huge pain nevertheless.
>
> If you want to make translator's life easier, I'd totally go with per
> option messages. If alignment is a problem (how?), I guess translation
> comments could be useful to describe how the translated string should
> look like.
>
> I assume you mean:
>
> --help Show this help string.
> --eggs Get two eggs from the fridge, crack them
> and put them on hot olive oil.
>
> It'd be difficult to align "Show" with "Get". I'd say that this
> depends a lot on the editor you use. Emacs at least makes it easy to
> calculate if you got it right or wrong.
I'm not convinced to change it (yet :-) ).
gettext manual says:
"""
Translatable strings should be limited to one paragraph; don't let a
single message be longer ***than ten lines.*** The reason is that when
the translatable string changes, the translator is faced with the task
"""
[...]
( http://www.gnu.org/software/gettext/manual/gettext.html )
I have not seen any program (again, yet, maybe Grub will be the first
one) to split the messages in this way. Emacs helps to calculate the
alignment, but other programs helps to compare the current and the
previous message. So the gettext manual is maybe a bit outdated. Plus,
these messages in Grub doesn't change often.
10 lines is reasonable in most cases.
So my concerns:
a) It change a common practise (even when it's not the best one).
Translators expects the way that it has been done until now, and I would
like that somebody that it's not Grub (small i18n project) starts the
change
b) Makes the alignment more difficult
c) Makes the code a bit less clear
Comment: sadly our grub.po already has someo of these long messages.
Would you change it and "force" the translators to change? Or have the
Grub domain with some long strings as short strings?
Maybe Colin has things to say too.
If next messages goes to the same direction (splitting) I'll propose a
way to split some non-gettexted message in Grub and then apply the same
to the other ones.
(Mmm... a nice start would be to split the very-repeated:
" -h, --help display this message and exit\n"
" -V, --version print version information and exit\n"
" -v, --verbose print verbose messages\n"
"\n"
"Report bugs to <%s>.\n"
In different sentences for all messsages.
)
Cheers,
--
Carles Pina i Estany
http://pinux.info
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 21:42 ` Carles Pina i Estany
@ 2010-03-27 22:20 ` Colin Watson
2010-03-27 22:36 ` Carles Pina i Estany
2010-03-28 12:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 1 reply; 11+ messages in thread
From: Colin Watson @ 2010-03-27 22:20 UTC (permalink / raw)
To: The development of GNU GRUB
On Sat, Mar 27, 2010 at 09:42:37PM +0000, Carles Pina i Estany wrote:
> I have not seen any program (again, yet, maybe Grub will be the first
> one) to split the messages in this way.
man-db does this, and it's fantastic. It vastly reduces the number of
translation changes I have to deal with. It wasn't practical until I
switched to the argp option parsing library which deals with a lot of
the presentation issues, so that may be why a lot of programs that just
use simple help output functions don't do it, but certainly as a
maintainer it's vastly easier once it's done, and I haven't heard any
complaints from translators.
> b) Makes the alignment more difficult
argp deals with this, and it's in Gnulib. We could import it without
too much difficulty.
> c) Makes the code a bit less clear
IME the code is actually rather clearer with argp. You can look at
man-db if you'd like to compare. In fact, I'd encourage that - it would
give us a common basis for discussion.
> Comment: sadly our grub.po already has someo of these long messages.
> Would you change it and "force" the translators to change?
Well, such a change would be one-time and would be not much more painful
than any addition of an option under the long-message system.
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 22:20 ` Colin Watson
@ 2010-03-27 22:36 ` Carles Pina i Estany
2010-03-27 23:16 ` Colin Watson
0 siblings, 1 reply; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-27 22:36 UTC (permalink / raw)
To: The development of GNU GRUB
Hi,
On Mar/27/2010, Colin Watson wrote:
> On Sat, Mar 27, 2010 at 09:42:37PM +0000, Carles Pina i Estany wrote:
> > I have not seen any program (again, yet, maybe Grub will be the first
> > one) to split the messages in this way.
>
> man-db does this, and it's fantastic. It vastly reduces the number of
> translation changes I have to deal with. It wasn't practical until I
> switched to the argp option parsing library which deals with a lot of
> the presentation issues, so that may be why a lot of programs that just
> use simple help output functions don't do it, but certainly as a
> maintainer it's vastly easier once it's done, and I haven't heard any
> complaints from translators.
I understand that you mean to use something like:
http://www.faqs.org/docs/learnc/x948.html
> > b) Makes the alignment more difficult
>
> argp deals with this, and it's in Gnulib. We could import it without
> too much difficulty.
I like this idea
> > c) Makes the code a bit less clear
>
> IME the code is actually rather clearer with argp. You can look at
> man-db if you'd like to compare. In fact, I'd encourage that - it
> would give us a common basis for discussion.
I will look into that
> > Comment: sadly our grub.po already has someo of these long messages.
> > Would you change it and "force" the translators to change?
>
> Well, such a change would be one-time and would be not much more
> painful than any addition of an option under the long-message system.
So, how it looks if I try to migrate to argp for the utils/* programs?
Probably I will not have lot of time on next days/weeks, but I will try
to migrate one of the utils/ program to discuss on it and then do the
same with the other ones.
Unless someone complains (please, do soon rather than later :-) ) that
argp would introduce some problems. I'm thinking with portability
problems or something like this.
Cheers,
--
Carles Pina i Estany
http://pinux.info
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 22:36 ` Carles Pina i Estany
@ 2010-03-27 23:16 ` Colin Watson
0 siblings, 0 replies; 11+ messages in thread
From: Colin Watson @ 2010-03-27 23:16 UTC (permalink / raw)
To: grub-devel
On Sat, Mar 27, 2010 at 10:36:39PM +0000, Carles Pina i Estany wrote:
> On Mar/27/2010, Colin Watson wrote:
> > On Sat, Mar 27, 2010 at 09:42:37PM +0000, Carles Pina i Estany wrote:
> > > I have not seen any program (again, yet, maybe Grub will be the first
> > > one) to split the messages in this way.
> >
> > man-db does this, and it's fantastic. It vastly reduces the number of
> > translation changes I have to deal with. It wasn't practical until I
> > switched to the argp option parsing library which deals with a lot of
> > the presentation issues, so that may be why a lot of programs that just
> > use simple help output functions don't do it, but certainly as a
> > maintainer it's vastly easier once it's done, and I haven't heard any
> > complaints from translators.
>
> I understand that you mean to use something like:
> http://www.faqs.org/docs/learnc/x948.html
I haven't read that particular document in detail, but yes, that's the
library and general pattern of code I mean.
Here's one of my examples, from a file chosen because it doesn't contain
very much else other than option parsing:
http://bazaar.launchpad.net/~cjwatson/man-db/trunk/annotate/head%3A/src/lexgrog_test.c
> > > Comment: sadly our grub.po already has someo of these long messages.
> > > Would you change it and "force" the translators to change?
> >
> > Well, such a change would be one-time and would be not much more
> > painful than any addition of an option under the long-message system.
>
> So, how it looks if I try to migrate to argp for the utils/* programs?
>
> Probably I will not have lot of time on next days/weeks, but I will try
> to migrate one of the utils/ program to discuss on it and then do the
> same with the other ones.
I'm not one of the maintainers, but I think that would be a good idea.
> Unless someone complains (please, do soon rather than later :-) ) that
> argp would introduce some problems. I'm thinking with portability
> problems or something like this.
As far as I know it should be fine; it's in Gnulib, which strives for
portability and is generally much more clueful about it than most
projects, so I'd give it good odds of being portable. I'm not deeply
familiar with how GRUB imports Gnulib code; it can't be quite standard
since we don't use Automake, so perhaps Vladimir should comment on
whether there are difficulties with any particular modules.
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-27 21:42 ` Carles Pina i Estany
2010-03-27 22:20 ` Colin Watson
@ 2010-03-28 12:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-03-28 22:05 ` Carles Pina i Estany
1 sibling, 1 reply; 11+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-03-28 12:48 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]
Carles Pina i Estany wrote:
> So my concerns:
> a) It change a common practise (even when it's not the best one).
> Translators expects the way that it has been done until now, and I would
> like that somebody that it's not Grub (small i18n project) starts the
> change
>
>
Jordi and Collin said that they are fed up with this "common practice"
> b) Makes the alignment more difficult
>
Why not just do like
" -h, --help %s\n"
" -V, --version %s\n"
" -v, --verbose %s\n", _("display this message and exit"), _ ("print version information and exit"), _("print verbose messages")
We won't translate --help anyway.
> c) Makes the code a bit less clear
>
Not if you use printf/sprintf templates
> Comment: sadly our grub.po already has someo of these long messages.
> Would you change it and "force" the translators to change? Or have the
> Grub domain with some long strings as short strings?
>
Another possibility is to change them to short strings when we'll change
this string next time.
> Maybe Colin has things to say too.
>
> If next messages goes to the same direction (splitting) I'll propose a
> way to split some non-gettexted message in Grub and then apply the same
> to the other ones.
>
> (Mmm... a nice start would be to split the very-repeated:
> " -h, --help display this message and exit\n"
> " -V, --version print version information and exit\n"
> " -v, --verbose print verbose messages\n"
> "\n"
> "Report bugs to <%s>.\n"
>
> In different sentences for all messsages.
> )
>
> Cheers,
>
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: gettext util
2010-03-28 12:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-03-28 22:05 ` Carles Pina i Estany
0 siblings, 0 replies; 11+ messages in thread
From: Carles Pina i Estany @ 2010-03-28 22:05 UTC (permalink / raw)
To: The development of GNU GRUB
Hello,
On Mar/28/2010, Vladimir '??-coder/phcoder' Serbinenko wrote:
> Carles Pina i Estany wrote:
> > b) Makes the alignment more difficult
> >
> Why not just do like
>
> " -h, --help %s\n"
> " -V, --version %s\n"
> " -v, --verbose %s\n", _("display this message and exit"), _ ("print version information and exit"), _("print verbose messages")
My reasons for argp:
a) if someone/something else can take care of counting how many spaces
before the short options, to write the "," and space and the long
option, etc. then is something that we don't need to think and do. Good for
consistency between Grub programs and other utilities
b) to not have some presentation things in Grub code (spaces, tabs,
etc.)
(main one:)
c) using above way is very easy to do mistakes and swap the description
and the command of some option, let's say, updating things OR options
that depends of the platform/compiler options. It needs two ifdef in two
places instead of only one in argp and more clear, since the argp structure is
like:
/* The options we understand. */
static struct argp_option options[] = {
{"verbose", 'v', 0, 0, "Produce verbose output" },
{"quiet", 'q', 0, 0, "Don't produce any output" },
All my reasons are valid if the implementation in Grub doesn't have
special problems, else I would re-consider...
Probably I'm forgetting some more positive things and missing some negative
ones.
Cheers,
--
Carles Pina i Estany
http://pinux.info
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-03-28 22:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 23:56 gettext util Carles Pina i Estany
2010-03-26 16:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-03-27 0:54 ` Carles Pina i Estany
2010-03-27 0:59 ` Carles Pina i Estany
2010-03-27 11:29 ` Jordi Mallach
2010-03-27 21:42 ` Carles Pina i Estany
2010-03-27 22:20 ` Colin Watson
2010-03-27 22:36 ` Carles Pina i Estany
2010-03-27 23:16 ` Colin Watson
2010-03-28 12:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-03-28 22:05 ` Carles Pina i Estany
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.