gettext util
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,
Signature · 2 lines
Carles Pina i Estany http://pinux.info
=== modified file 'ChangeLog'
ChangeLog +16 -0
@@ -1,3 +1,19 @@ +2010-03-19 Carles Pina i Estany <[email protected]> + + * 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 <[email protected]> * .bzrignore: Add gentrigtables, grub-script-check,
=== modified file 'po/POTFILES'
POTFILES +12 -0
@@ -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'
grub-editenv.c +5 -5
@@ -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'
grub-emu.c +5 -5
@@ -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; }
@@ -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'
grub-fstest.c +8 -8
@@ -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'
grub-macho2img.c +7 -7
@@ -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'
grub-mkdevicemap.c +3 -4
@@ -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'
grub-mkfont.c +9 -9
@@ -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 *fif (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'
grub-mkpasswd-pbkdf2.c +6 -6
@@ -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'
grub-mkrelpath.c +5 -5
@@ -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'
grub-pe2elf.c +4 -4
@@ -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'
grub-probe.c +5 -5
@@ -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'
grub-script-check.c +4 -5
@@ -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
Quoted 11 lines · Carles Pina i Estany
Hello,
Last January I asked for ok to commit this to trunk:
http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00373.htmlI'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?
Quoted 13 lines
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
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Hello,
Quoted 10 lines · Vladimir '??-coder/phcoder' Serbinenko
Quoted 9 lines · Carles Pina i Estany
Hello,
Last January I asked for ok to commit this to trunk:
http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00373.htmlI'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.
Quoted 5 lines
Quoted 2 lines
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
Quoted 2 lines
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,
Signature · 2 lines
Carles Pina i Estany http://pinux.info
Hi,
Quoted 10 lines · Carles Pina i Estany
Quoted 3 lines
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#n252They 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.
Signature · 2 lines
Carles Pina i Estany http://pinux.info
Hi Carles,
Quoted 8 lines · Carles Pina i Estany
Quoted 3 lines
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
Quoted 7 lines
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
Signature · 3 lines
Jordi Mallach Pérez -- Debian developer http://www.debian.org/ [email protected] [email protected] http://www.sindominio.net/ GnuPG public key information available at http://oskuro.net/
Hi,
Quoted 15 lines · Jordi Mallach
Quoted 14 lines · Carles Pina i Estany
Quoted 3 lines
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#n252They 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 :-/
Quoted 6 lines
Quoted 1 line
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
Quoted 10 lines
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:
Quoted 7 lines
--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,
Signature · 2 lines
Carles Pina i Estany http://pinux.info
Quoted 2 lines · Carles Pina i Estany
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.
Quoted 1 line
b) Makes the alignment more difficult
argp deals with this, and it's in Gnulib. We could import it without too much difficulty.
Quoted 1 line
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.
Quoted 2 lines
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.
Signature · 1 line
Colin Watson [[email protected]]
Hi,
Quoted 11 lines · Colin Watson
Quoted 2 lines · Carles Pina i Estany
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
Quoted 4 lines
Quoted 1 line
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
Quoted 5 lines
Quoted 1 line
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
Quoted 5 lines
Quoted 2 lines
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,
Signature · 2 lines
Carles Pina i Estany http://pinux.info
Quoted 13 lines · Carles Pina i Estany
Quoted 11 lines · Colin Watson
Quoted 2 lines · Carles Pina i Estany
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.
Quoted 2 lines
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
Quoted 11 lines
Quoted 5 lines
Quoted 2 lines
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.
Quoted 3 lines
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.
Signature · 1 line
Colin Watson [[email protected]]
Quoted 7 lines · Carles Pina i Estany
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"
Quoted 2 lines
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.
Quoted 2 lines
c) Makes the code a bit less clear
Not if you use printf/sprintf templates
Quoted 4 lines
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.
Quoted 19 lines
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,
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Hello,
Quoted 9 lines · Vladimir '??-coder/phcoder' Serbinenko
Quoted 2 lines · Carles Pina i Estany
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,
Signature · 2 lines
Carles Pina i Estany http://pinux.info