X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=cups%2Ftestppd.c;h=9efa851f5a32e5af2a3923accaf4ed33cff36de8;hb=5a738aeaea5c4dd9384a8601cc5c99be683b69ca;hp=e88a125682f6bbc5294a4936a8022024e5e632d5;hpb=d9bca400bee5f6168a7e07f85279251f040d734c;p=thirdparty%2Fcups.git diff --git a/cups/testppd.c b/cups/testppd.c index e88a12568..9efa851f5 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -99,6 +99,7 @@ main(int argc, /* I - Number of command-line arguments */ int conflicts; /* Number of conflicts */ char *s; /* String */ char buffer[8192]; /* String buffer */ + const char *text; /* Localized text */ status = 0; @@ -235,6 +236,60 @@ main(int argc, /* I - Number of command-line arguments */ status ++; printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer); } + + /* + * cupsMarkerName localization... + */ + + putenv("LANG=en"); + + fputs("ppdLocalizeMarkerName(bogus): ", stdout); + + if ((text = ppdLocalizeMarkerName(ppd, "bogus")) != NULL) + { + status ++; + printf("FAIL (\"%s\" instead of NULL)\n", text); + } + else + puts("PASS"); + + fputs("ppdLocalizeMarkerName(cyan): ", stdout); + + if ((text = ppdLocalizeMarkerName(ppd, "cyan")) != NULL && + !strcmp(text, "Cyan Toner")) + puts("PASS"); + else + { + status ++; + printf("FAIL (\"%s\" instead of \"Cyan Toner\")\n", + text ? text : "(null)"); + } + + putenv("LANG=fr"); + + fputs("ppdLocalizeMarkerName(fr cyan): ", stdout); + if ((text = ppdLocalizeMarkerName(ppd, "cyan")) != NULL && + !strcmp(text, "La Toner Cyan")) + puts("PASS"); + else + { + status ++; + printf("FAIL (\"%s\" instead of \"La Toner Cyan\")\n", + text ? text : "(null)"); + } + + putenv("LANG=zh_TW"); + + fputs("ppdLocalizeMarkerName(zh_TW cyan): ", stdout); + if ((text = ppdLocalizeMarkerName(ppd, "cyan")) != NULL && + !strcmp(text, "Number 1 Cyan Toner")) + puts("PASS"); + else + { + status ++; + printf("FAIL (\"%s\" instead of \"Number 1 Cyan Toner\")\n", + text ? text : "(null)"); + } } else {