Hi,

While translating bash's messages, I noticed that some messages 
haven't been gettextized.  Attached patch fixes these -- just the 
ones I happened to notice, I haven't done a full inspection.

The first patch also fixes a typo, and changes a trailing space to 
a leading one (preferred by translators).

On the other hand, it looks like all of the message strings in 
lib/malloc/watch.c are debugging messages, which will never be seen 
by a normal user, and therefore do not need to be gettextized at 
all?


In many short doc strings the case of the parameters in the first 
line does not match the case in the rest of the explanation.  The 
second patch fixes this for some strings.  I can make a patch that 
fixes them all, if you agree that this is the right thing to do.

Much better than just that would be: if also the first line of the 
short doc string were gettextized (like they used to be in older 
versions of bash), so that in the explanation one doesn't have to 
use English words for the parameters but can translate also these 
to the target language.

The second patch also fixes the style (third person) and casing in  
some of the explanations, and tries to improve two others.


Please consider releasing another version of bash in a month or so, 
with the above fixes, but mainly with the superfluous "N_(...)" 
lines removed from caller.def and pushd.def.  Those had me puzzled 
for a day why my translation of them wasn't working.  And anyway, 
translators get discouraged just seeing such chopped up sentences.

Benno
diff -ur bash-3.2.orig/builtins/bind.def bash-3.2.new/builtins/bind.def
--- bash-3.2.orig/builtins/bind.def	2003-12-19 23:56:34.000000000 +0100
+++ bash-3.2.new/builtins/bind.def	2006-11-24 20:05:42.000000000 +0100
@@ -310,7 +310,7 @@
   function = rl_named_function (name);
   if (function == 0)
     {
-      builtin_error ("`%s': unknown function name", name);
+      builtin_error (_("`%s': unknown function name"), name);
       return EXECUTION_FAILURE;
     }
 
diff -ur bash-3.2.orig/builtins/hash.def bash-3.2.new/builtins/hash.def
--- bash-3.2.orig/builtins/hash.def	2006-02-21 20:59:45.000000000 +0100
+++ bash-3.2.new/builtins/hash.def	2006-11-24 20:05:42.000000000 +0100
@@ -158,7 +158,7 @@
 #ifdef EISDIR
 	      builtin_error ("%s: %s", pathname, strerror (EISDIR));
 #else
-	      builtin_error ("%s: is a directory", pathname);
+	      builtin_error (_("%s: is a directory"), pathname);
 #endif
 	      opt = EXECUTION_FAILURE;
 	    }
diff -ur bash-3.2.orig/builtins/inlib.def bash-3.2.new/builtins/inlib.def
--- bash-3.2.orig/builtins/inlib.def	2002-03-19 20:20:49.000000000 +0100
+++ bash-3.2.new/builtins/inlib.def	2006-11-24 20:05:42.000000000 +0100
@@ -64,7 +64,7 @@
 
       if (status.all != status_$ok)
 	{
-	  builtin_error ("%s: inlib failed", list->word->word);
+	  builtin_error (_("%s: inlib failed"), list->word->word);
 	  return_value = EXECUTION_FAILURE;
 	}
 
diff -ur bash-3.2.orig/builtins/printf.def bash-3.2.new/builtins/printf.def
--- bash-3.2.orig/builtins/printf.def	2006-09-18 14:48:42.000000000 +0200
+++ bash-3.2.new/builtins/printf.def	2006-11-24 20:05:42.000000000 +0100
@@ -540,7 +540,7 @@
 printf_erange (s)
      char *s;
 {
-  builtin_error ("warning: %s: %s", s, strerror(ERANGE));
+  builtin_error (_("warning: %s: %s"), s, strerror(ERANGE));
 }
 
 /* We duplicate a lot of what printf(3) does here. */
diff -ur bash-3.2.orig/builtins/pushd.def bash-3.2.new/builtins/pushd.def
--- bash-3.2.orig/builtins/pushd.def	2006-03-06 15:41:33.000000000 +0100
+++ bash-3.2.new/builtins/pushd.def	2006-11-24 20:05:42.000000000 +0100
@@ -483,9 +483,9 @@
      char *arg;
 {
   if (offset == 0)
-    builtin_error ("directory stack empty");
+    builtin_error (_("directory stack is empty"));
   else
-    sh_erange (arg, "directory stack index");
+    sh_erange (arg, _("directory stack index"));
 }
 
 static void
diff -ur bash-3.2.orig/builtins/test.def bash-3.2.new/builtins/test.def
--- bash-3.2.orig/builtins/test.def	2002-04-04 21:48:17.000000000 +0200
+++ bash-3.2.new/builtins/test.def	2006-11-24 20:05:42.000000000 +0100
@@ -131,7 +131,7 @@
     {
       if (this_command_name[0] == '[' && !this_command_name[1])
 	{
-	  builtin_error ("missing `]'");
+	  builtin_error (_("missing `]'"));
 	  return (EX_BADUSAGE);
 	}
 
diff -ur bash-3.2.orig/builtins/ulimit.def bash-3.2.new/builtins/ulimit.def
--- bash-3.2.orig/builtins/ulimit.def	2006-03-23 21:51:51.000000000 +0100
+++ bash-3.2.new/builtins/ulimit.def	2006-11-24 20:05:42.000000000 +0100
@@ -675,7 +675,7 @@
       if (get_limit (i, &softlim, &hardlim) == 0)
 	printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
       else if (errno != EINVAL)
-	builtin_error ("%s: cannot get limit: %s", limits[i].description,
+	builtin_error (_("%s: cannot get limit: %s"), limits[i].description,
 						   strerror (errno));
     }
 }
@@ -740,7 +740,7 @@
   for (retval = i = 0; limits[i].option > 0; i++)
     if (set_limit (i, newlim, mode) < 0)
       {
-	builtin_error ("%s: cannot modify limit: %s", limits[i].description,
+	builtin_error (_("%s: cannot modify limit: %s"), limits[i].description,
 						      strerror (errno));
 	retval = 1;
       }
diff -ur bash-3.2.orig/lib/malloc/malloc.c bash-3.2.new/lib/malloc/malloc.c
--- bash-3.2.orig/lib/malloc/malloc.c	2005-10-26 14:09:29.000000000 +0200
+++ bash-3.2.new/lib/malloc/malloc.c	2006-11-24 20:05:42.000000000 +0100
@@ -312,7 +312,7 @@
      int line;
 {
   fprintf (stderr, _("\r\nmalloc: %s:%d: assertion botched\r\n"),
-			file ? file : "unknown", line);
+			file ? file : _("unknown"), line);
 #ifdef MALLOC_REGISTER
   if (mem != NULL && malloc_register)
     mregister_describe_mem (mem, stderr);
diff -ur bash-3.2.orig/lib/malloc/watch.c bash-3.2.new/lib/malloc/watch.c
--- bash-3.2.orig/lib/malloc/watch.c	2003-12-20 01:22:30.000000000 +0100
+++ bash-3.2.new/lib/malloc/watch.c	2006-11-24 20:05:42.000000000 +0100
@@ -53,10 +53,10 @@
   else
     tag = _("bug: unknown operation");
 
-  fprintf (stderr, _("malloc: watch alert: %p %s "), addr, tag);
+  fprintf (stderr, _("malloc: watch alert: %p %s"), addr, tag);
   if (data != (unsigned long)-1)
-    fprintf (stderr, "(size %lu) ", data);
-  fprintf (stderr, "from '%s:%d'\n", file ? file : "unknown", line);
+    fprintf (stderr, _(" (size %lu)"), data);
+  fprintf (stderr, _(" from '%s:%d'\n"), file ? file : _("unknown"), line);
 }
 
 void
diff -ur bash-3.2.orig/shell.c bash-3.2.new/shell.c
--- bash-3.2.orig/shell.c	2006-05-17 14:46:54.000000000 +0200
+++ bash-3.2.new/shell.c	2006-11-24 20:05:42.000000000 +0100
@@ -1416,7 +1416,7 @@
 	}
       else if (sample_len > 0 && (check_binary_file (sample, sample_len)))
 	{
-	  internal_error ("%s: cannot execute binary file", filename);
+	  internal_error (_("%s: cannot execute binary file"), filename);
 	  exit (EX_BINARY_FILE);
 	}
       /* Now rewind the file back to the beginning. */
diff -ur bash-3.2.orig/subst.c bash-3.2.new/subst.c
--- bash-3.2.orig/subst.c	2006-09-19 14:35:09.000000000 +0200
+++ bash-3.2.new/subst.c	2006-11-24 20:05:42.000000000 +0100
@@ -4364,7 +4364,7 @@
     {
       if (sh_unset_nodelay_mode (fd) < 0)
 	{
-	  sys_error (_("cannout reset nodelay mode for fd %d"), fd);
+	  sys_error (_("cannot reset nodelay mode for fd %d"), fd);
 	  exit (127);
 	}
     }
diff -ur bash-3.2.orig/builtins/break.def bash-3.2.new/builtins/break.def
--- bash-3.2.orig/builtins/break.def	2003-12-19 23:56:38.000000000 +0100
+++ bash-3.2.new/builtins/break.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 
 $BUILTIN break
 $FUNCTION break_builtin
-$SHORT_DOC break [n]
+$SHORT_DOC break [N]
 Exit from within a FOR, WHILE or UNTIL loop.  If N is specified,
 break N levels.
 $END
@@ -85,7 +85,7 @@
 
 $BUILTIN continue
 $FUNCTION continue_builtin
-$SHORT_DOC continue [n]
+$SHORT_DOC continue [N]
 Resume the next iteration of the enclosing FOR, WHILE or UNTIL loop.
 If N is specified, resume at the N-th enclosing loop.
 $END
diff -ur bash-3.2.orig/builtins/exit.def bash-3.2.new/builtins/exit.def
--- bash-3.2.orig/builtins/exit.def	2005-02-11 17:46:55.000000000 +0100
+++ bash-3.2.new/builtins/exit.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 
 $BUILTIN exit
 $FUNCTION exit_builtin
-$SHORT_DOC exit [n]
+$SHORT_DOC exit [N]
 Exit the shell with a status of N.  If N is omitted, the exit status
 is that of the last command executed.
 $END
diff -ur bash-3.2.orig/builtins/return.def bash-3.2.new/builtins/return.def
--- bash-3.2.orig/builtins/return.def	2003-12-20 00:30:47.000000000 +0100
+++ bash-3.2.new/builtins/return.def	2006-11-24 20:07:17.000000000 +0100
@@ -24,7 +24,7 @@
 $BUILTIN return
 
 $FUNCTION return_builtin
-$SHORT_DOC return [n]
+$SHORT_DOC return [N]
 Causes a function to exit with the return value specified by N.  If N
 is omitted, the return status is that of the last command.
 $END
diff -ur bash-3.2.orig/builtins/shift.def bash-3.2.new/builtins/shift.def
--- bash-3.2.orig/builtins/shift.def	2004-02-09 21:02:41.000000000 +0100
+++ bash-3.2.new/builtins/shift.def	2006-11-24 20:07:17.000000000 +0100
@@ -38,7 +38,7 @@
 
 $BUILTIN shift
 $FUNCTION shift_builtin
-$SHORT_DOC shift [n]
+$SHORT_DOC shift [N]
 The positional parameters from $N+1 ... are renamed to $1 ...  If N is
 not given, it is assumed to be 1.
 $END
diff -ur bash-3.2.orig/builtins/test.def bash-3.2.new/builtins/test.def
--- bash-3.2.orig/builtins/test.def	2002-04-04 21:48:17.000000000 +0200
+++ bash-3.2.new/builtins/test.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 
 $BUILTIN test
 $FUNCTION test_builtin
-$SHORT_DOC test [expr]
+$SHORT_DOC test [EXPR]
 Exits with a status of 0 (true) or 1 (false) depending on
 the evaluation of EXPR.  Expressions may be unary or binary.  Unary
 expressions are often used to examine the status of a file.  There
diff -ur bash-3.2.orig/builtins/wait.def bash-3.2.new/builtins/wait.def
--- bash-3.2.orig/builtins/wait.def	2006-07-28 21:13:34.000000000 +0200
+++ bash-3.2.new/builtins/wait.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 $FUNCTION wait_builtin
 $DEPENDS_ON JOB_CONTROL
 $PRODUCES wait.c
-$SHORT_DOC wait [n]
+$SHORT_DOC wait [N]
 Wait for the specified process and report its termination status.  If
 N is not given, all currently active child processes are waited for,
 and the return code is zero.  N may be a process ID or a job
@@ -34,7 +34,7 @@
 $BUILTIN wait
 $FUNCTION wait_builtin
 $DEPENDS_ON !JOB_CONTROL
-$SHORT_DOC wait [n]
+$SHORT_DOC wait [N]
 Wait for the specified process and report its termination status.  If
 N is not given, all currently active child processes are waited for,
 and the return code is zero.  N is a process ID; if it is not given,
diff -ur bash-3.2.orig/builtins/reserved.def bash-3.2.new/builtins/reserved.def
--- bash-3.2.orig/builtins/reserved.def	2006-03-07 20:30:00.000000000 +0100
+++ bash-3.2.new/builtins/reserved.def	2006-11-24 20:07:17.000000000 +0100
@@ -30,7 +30,7 @@
 
 $BUILTIN for ((
 $DOCNAME arith_for
-$SHORT_DOC for (( exp1; exp2; exp3 )); do COMMANDS; done
+$SHORT_DOC for (( EXP1; EXP2; EXP3 )); do COMMANDS; done
 Equivalent to
 	(( EXP1 ))
 	while (( EXP2 )); do
diff -ur bash-3.2.orig/builtins/alias.def bash-3.2.new/builtins/alias.def
--- bash-3.2.orig/builtins/alias.def	2004-04-22 16:48:43.000000000 +0200
+++ bash-3.2.new/builtins/alias.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 $FUNCTION alias_builtin
 $DEPENDS_ON ALIAS
 $PRODUCES alias.c
-$SHORT_DOC alias [-p] [name[=value] ... ]
+$SHORT_DOC alias [-p] [NAME[=VALUE] ... ]
 `alias' with no arguments or with the -p option prints the list
 of aliases in the form alias NAME=VALUE on standard output.
 Otherwise, an alias is defined for each NAME whose VALUE is given.
@@ -148,7 +148,7 @@
 $BUILTIN unalias
 $FUNCTION unalias_builtin
 $DEPENDS_ON ALIAS
-$SHORT_DOC unalias [-a] name [name ...]
+$SHORT_DOC unalias [-a] NAME [NAME ...]
 Remove NAMEs from the list of defined aliases.  If the -a option is given,
 then remove all alias definitions.
 $END
diff -ur bash-3.2.orig/builtins/declare.def bash-3.2.new/builtins/declare.def
--- bash-3.2.orig/builtins/declare.def	2006-01-29 01:34:11.000000000 +0100
+++ bash-3.2.new/builtins/declare.def	2006-11-24 20:07:17.000000000 +0100
@@ -23,7 +23,7 @@
 
 $BUILTIN declare
 $FUNCTION declare_builtin
-$SHORT_DOC declare [-afFirtx] [-p] [name[=value] ...]
+$SHORT_DOC declare [-afFirtx] [-p] [NAME[=VALUE] ...]
 Declare variables and/or give them attributes.  If no NAMEs are
 given, then display the values of variables instead.  The -p option
 will display the attributes and values of each NAME.
@@ -52,7 +52,7 @@
 
 $BUILTIN typeset
 $FUNCTION declare_builtin
-$SHORT_DOC typeset [-afFirtx] [-p] name[=value] ...
+$SHORT_DOC typeset [-afFirtx] [-p] NAME[=VALUE] ...
 Obsolete.  See `declare'.
 $END
 
@@ -90,8 +90,8 @@
 
 $BUILTIN local
 $FUNCTION local_builtin
-$SHORT_DOC local name[=value] ...
-Create a local variable called NAME, and give it VALUE.  LOCAL
+$SHORT_DOC local NAME[=VALUE] ...
+Create a local variable called NAME, and give it VALUE.  'local'
 can only be used within a function; it makes the variable NAME
 have a visible scope restricted to that function and its children.
 $END
diff -ur bash-3.2.orig/builtins/cd.def bash-3.2.new/builtins/cd.def
--- bash-3.2.orig/builtins/cd.def	2006-07-28 03:35:36.000000000 +0200
+++ bash-3.2.new/builtins/cd.def	2006-11-24 20:07:17.000000000 +0100
@@ -72,9 +72,9 @@
 
 $BUILTIN cd
 $FUNCTION cd_builtin
-$SHORT_DOC cd [-L|-P] [dir]
-Change the current directory to DIR.  The variable $HOME is the
-default DIR.  The variable CDPATH defines the search path for
+$SHORT_DOC cd [-L|-P] [DIR]
+Changes the current directory to DIR.  The default for DIR is the value
+of the variable HOME.  The variable CDPATH defines the search path for
 the directory containing DIR.  Alternative directory names in CDPATH
 are separated by a colon (:).  A null directory name is the same as
 the current directory, i.e. `.'.  If DIR begins with a slash (/),
diff -ur bash-3.2.orig/builtins/pushd.def bash-3.2.new/builtins/pushd.def
--- bash-3.2.orig/builtins/pushd.def	2006-03-06 15:41:33.000000000 +0100
+++ bash-3.2.new/builtins/pushd.def	2006-11-24 20:07:17.000000000 +0100
@@ -24,7 +24,7 @@
 $BUILTIN pushd
 $FUNCTION pushd_builtin
 $DEPENDS_ON PUSHD_AND_POPD
-$SHORT_DOC pushd [dir | +N | -N] [-n]
+$SHORT_DOC pushd [DIR | +N | -N] [-n]
 Adds a directory to the top of the directory stack, or rotates
 the stack, making the new top of the stack the current working
 directory.  With no arguments, exchanges the top two directories.
@@ -37,10 +37,10 @@
 	from the right of the list shown by `dirs', starting with
 	zero) is at the top.
 
--n	suppress the normal change of directory when adding directories
-	to the stack, so only the stack is manipulated.
+-n	Suppresses the normal change of directory when adding
+	directories to the stack, so only the stack is manipulated.
 
-dir	adds DIR to the directory stack at the top, making it the
+DIR	Adds DIR to the directory stack at the top, making it the
 	new current working directory.
 
 You can see the directory stack with the `dirs' command.
@@ -54,16 +54,16 @@
 removes the top directory from the stack, and cd's to the new
 top directory.
 
-+N	removes the Nth entry counting from the left of the list
++N	Removes the Nth entry counting from the left of the list
 	shown by `dirs', starting with zero.  For example: `popd +0'
 	removes the first directory, `popd +1' the second.
 
--N	removes the Nth entry counting from the right of the list
+-N	Removes the Nth entry counting from the right of the list
 	shown by `dirs', starting with zero.  For example: `popd -0'
 	removes the last directory, `popd -1' the next to last.
 
--n	suppress the normal change of directory when removing directories
-	from the stack, so only the stack is manipulated.
+-n	Suppresses the normal change of directory when removing
+	directories from the stack, so only the stack is manipulated.
 
 You can see the directory stack with the `dirs' command.
 $END
@@ -72,7 +72,7 @@
 $FUNCTION dirs_builtin
 $DEPENDS_ON PUSHD_AND_POPD
 $SHORT_DOC dirs [-clpv] [+N] [-N]
-Display the list of currently remembered directories.  Directories
+Displays the list of currently remembered directories.  Directories
 find their way onto the list with the `pushd' command; you can get
 back up through the list with the `popd' command.
 
@@ -84,10 +84,10 @@
 flag does the same thing, but the stack position is not prepended.
 The -c flag clears the directory stack by deleting all of the elements.
 
-+N	displays the Nth entry counting from the left of the list shown by
++N	Displays the Nth entry counting from the left of the list shown by
 	dirs when invoked without options, starting with zero.
 
--N	displays the Nth entry counting from the right of the list shown by
+-N	Displays the Nth entry counting from the right of the list shown by
 	dirs when invoked without options, starting with zero.
 $END
 
diff -ur bash-3.2.orig/builtins/times.def bash-3.2.new/builtins/times.def
--- bash-3.2.orig/builtins/times.def	2002-03-19 16:44:34.000000000 +0100
+++ bash-3.2.new/builtins/times.def	2006-11-24 20:07:17.000000000 +0100
@@ -24,8 +24,8 @@
 $BUILTIN times
 $FUNCTION times_builtin
 $SHORT_DOC times
-Print the accumulated user and system times for processes run from
-the shell.
+Print the accumulated user and system times, for the shell itself
+and for processes run from the shell.
 $END
 
 #include <config.h>
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to