]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - locale/po2strings.c
Merge changes from CUPS 1.5svn-r9641
[thirdparty/cups.git] / locale / po2strings.c
index ce89266e0780c3a976ab9ad319d1c4caf035d30b..97f9cc337c2d17151c1e1596825e63fcf761c26a 100644 (file)
@@ -130,21 +130,36 @@ main(int  argc,                           /* I - Number of command-line args */
 
   while (cupsFileGets(po, s, sizeof(s)) != NULL)
   {
 
   while (cupsFileGets(po, s, sizeof(s)) != NULL)
   {
-    if ((s[0] == '#' && s[0] != '.') || !s[0])
+    if (s[0] == '#' && s[1] == '.')
     {
      /*
     {
      /*
-      * Skip blank and file comment lines...
+      * Copy comment string...
       */
 
       */
 
-      continue;
+      if (msgid && msgstr)
+      {
+       /*
+        * First output the last localization string...
+       */
+
+       if (*msgid)
+         cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
+                        (use_msgid || !*msgstr) ? msgid : msgstr);
+
+       free(msgid);
+       free(msgstr);
+       msgid = msgstr = NULL;
+      }
+
+      cupsFilePrintf(strings, "//%s\n", s + 2);
     }
     }
-    else if (s[0] == '#')
+    else if (s[0] == '#' || !s[0])
     {
      /*
     {
      /*
-      * Copy comment string...
+      * Skip blank and file comment lines...
       */
 
       */
 
-      cupsFilePrintf(strings, "//%s\n", s + 2);
+      continue;
     }
     else
     {
     }
     else
     {
@@ -179,7 +194,7 @@ main(int  argc,                             /* I - Number of command-line args */
         if (msgid && msgstr)
        {
          if (*msgid)
         if (msgid && msgstr)
        {
          if (*msgid)
-            cupsFilePrintf(strings, "\"%s\" = \"%s\";\n\n", msgid,
+            cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
                           (use_msgid || !*msgstr) ? msgid : msgstr);
 
          free(msgid);
                           (use_msgid || !*msgstr) ? msgid : msgstr);
 
          free(msgid);
@@ -247,7 +262,7 @@ main(int  argc,                             /* I - Number of command-line args */
   if (msgid && msgstr)
   {
     if (*msgid)
   if (msgid && msgstr)
   {
     if (*msgid)
-      cupsFilePrintf(strings, "\"%s\" = \"%s\";\n\n", msgid,
+      cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
                     (use_msgid || !*msgstr) ? msgid : msgstr);
 
     free(msgid);
                     (use_msgid || !*msgstr) ? msgid : msgstr);
 
     free(msgid);