X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=locale%2Fpo2strings.c;h=97f9cc337c2d17151c1e1596825e63fcf761c26a;hp=ce89266e0780c3a976ab9ad319d1c4caf035d30b;hb=84315f460a5c9eb38f7fcc4204acf98ed2b29406;hpb=82f972324ddde683be8a6d302f9937532ab0cf81 diff --git a/locale/po2strings.c b/locale/po2strings.c index ce89266e0..97f9cc337 100644 --- a/locale/po2strings.c +++ b/locale/po2strings.c @@ -130,21 +130,36 @@ main(int argc, /* I - Number of command-line args */ 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 { @@ -179,7 +194,7 @@ main(int argc, /* I - Number of command-line args */ 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); @@ -247,7 +262,7 @@ main(int argc, /* I - Number of command-line args */ 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);