All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carles Pina i Estany <carles@pina.cat>
To: grub-devel@gnu.org
Subject: gettext util
Date: Fri, 19 Mar 2010 23:56:56 +0000	[thread overview]
Message-ID: <20100319235656.GA1677@pina.cat> (raw)

[-- 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


             reply	other threads:[~2010-03-19 23:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 23:56 Carles Pina i Estany [this message]
2010-03-26 16:00 ` gettext util 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100319235656.GA1677@pina.cat \
    --to=carles@pina.cat \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.