]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - locale/checkpo.c
Update localization of IPP attribute/value pairs (Issue #5495)
[thirdparty/cups.git] / locale / checkpo.c
index 4e6052b8e452dac5e45c719ee462c43150786dbe..00217af35143793e487c3bd6177c2472c9979646 100644 (file)
@@ -70,7 +70,7 @@ main(int  argc,                               /* I - Number of command-line args */
     if (strstr(argv[i], ".strings"))
       po = _cupsMessageLoad(argv[i], _CUPS_MESSAGE_STRINGS);
     else
-      po = _cupsMessageLoad(argv[i], _CUPS_MESSAGE_PO);
+      po = _cupsMessageLoad(argv[i], _CUPS_MESSAGE_PO | _CUPS_MESSAGE_EMPTY);
 
     if (!po)
     {
@@ -156,7 +156,6 @@ main(int  argc,                             /* I - Number of command-line args */
               abbreviate(msg->msg, idbuf, sizeof(idbuf)));
       }
 
-
       if (!msg->str || !msg->str[0])
       {
         untranslated ++;
@@ -257,8 +256,7 @@ main(int  argc,                             /* I - Number of command-line args */
 
     if (pass)
     {
-      if ((untranslated * 10) >= cupsArrayCount(po) &&
-          strcmp(argv[i], "cups.pot"))
+      if (untranslated >= (cupsArrayCount(po) / 10) && strcmp(argv[i], "cups.pot"))
       {
        /*
         * Only allow 10% of messages to be untranslated before we fail...
@@ -266,12 +264,10 @@ main(int  argc,                           /* I - Number of command-line args */
 
         pass = 0;
         puts("FAIL");
-       printf("    Too many untranslated messages (%d of %d)\n",
-              untranslated, cupsArrayCount(po));
+       printf("    Too many untranslated messages (%d of %d or %.1f%%)\n", untranslated, cupsArrayCount(po), 100.0 * untranslated / cupsArrayCount(po));
       }
       else if (untranslated > 0)
-        printf("PASS (%d of %d untranslated)\n", untranslated,
-              cupsArrayCount(po));
+        printf("PASS (%d of %d untranslated or %.1f%%)\n", untranslated, cupsArrayCount(po), 100.0 * untranslated / cupsArrayCount(po));
       else
         puts("PASS");
     }