]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Cosmetic tweaks for the msginit output.
authorBruno Haible <bruno@clisp.org>
Mon, 19 Nov 2001 10:58:24 +0000 (10:58 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 21:20:02 +0000 (23:20 +0200)
src/ChangeLog
src/msginit.c

index d0fbd80443b4959f58a1e3a4c4944912b9e6acdb..1080549dd0ec4ed7c1debd1284e961008df9255d 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-17  Bruno Haible  <haible@clisp.cons.org>
+
+       * msginit.c (main): Print a blank line.
+       (get_title): Always use the English title first.
+       (fill_header): Update accordingly.
+
 2001-11-17  Bruno Haible  <haible@clisp.cons.org>
 
        * message.h (NFORMATS): Fix misapplied patch.
index 674bb09592a3c42c17fd366ce22997b7db76fdab..2b8422806c7e9bb221e7aa0e0d9ddc77c0447685 100644 (file)
@@ -316,7 +316,8 @@ the output .po file through the --output-file option.\n"),
   /* Write the modified message list out.  */
   msgdomain_list_print (result, output_file, true, false);
 
-  fprintf (stderr, "Created %s.\n", output_file);
+  fprintf (stderr, "\n");
+  fprintf (stderr, _("Created %s.\n"), output_file);
 
   exit (EXIT_SUCCESS);
 }
@@ -1344,6 +1345,7 @@ get_title ()
   char *old_LANGUAGE;
   char *old_OUTPUT_CHARSET;
   const char *msgid;
+  const char *english;
   const char *result;
 
   encoding = canonical_locale_charset ();
@@ -1367,16 +1369,22 @@ get_title ()
   setlocale (LC_ALL, "");
 #endif
 
+  /* First, the English title.  */
+  english = xasprintf ("%s translations for %%s package",
+                      englishname_of_language ());
+
   /* Fetch the translation.  */
   /* TRANSLATORS: "English" needs to be replaced by your language.
      For example in it.po write "Traduzioni italiani ...",
      *not* "Traduzioni inglesi ...".  */
   msgid = N_("English translations for %s package");
   result = gettext (msgid);
-  if (result == msgid)
-    /* No translation found.  */
-    result = xasprintf ("%s translations for %%s package",
-                       englishname_of_language ());
+  if (result != msgid && strcmp (result, msgid) != 0)
+    /* Use the English and the foreign title.  */
+    result = xasprintf ("%s\n%s", english, result);
+  else
+    /* No translation found.  Use the English title.  */
+    result = english;
 
   /* Restore LC_ALL, LANGUAGE, OUTPUT_CHARSET environment variables.  */
 
@@ -1494,6 +1502,7 @@ fill_header (mdlp)
          message_ty *header_mp = NULL;
          char *header;
          const char *subst[3][2];
+         const char *id;
          time_t now;
 
          /* Search the header entry.  */
@@ -1535,7 +1544,7 @@ fill_header (mdlp)
 
          /* Update the comments in the header entry.  */
          subst[0][0] = "SOME DESCRIPTIVE TITLE";
-         subst[0][1] = xasprintf (get_title (), project_id ());
+         subst[0][1] = (id = project_id (), xasprintf (get_title (), id, id));
          subst[1][0] = "FIRST AUTHOR <EMAIL@ADDRESS>";
          subst[1][1] = field_value[FIELD_LAST_TRANSLATOR];
          subst[2][0] = "YEAR";