15 typedef struct _testcase testcase;
17 static testcase testcases[] = {
19 "[DO_NOT_TRANSLATE_THIS_MARKER]",
20 "[DO_NOT_TRANSLATE_THIS_MARKER]" },
22 "[DO_NOT_TRANSLATE_THIS_MARKER]",
23 "[DO_NOT_TRANSLATE_THIS_MARKER_de]" },
26 int main(int argc, char *argv[])
32 puts("Syntax: test-nls <localedir>\n");
38 for (i=0; i < sizeof(testcases)/sizeof(testcases[0]); i++) {
39 char *locale = testcases[i].locale;
40 char *untranslated = testcases[i].untranslated;
41 char *expected = testcases[i].expected;
45 printf("setlocale to %s\n", locale);
46 actual_locale = setlocale(LC_MESSAGES, locale);
48 if (actual_locale == NULL) {
49 fprintf(stderr, "Error: Cannot set locale to %s.\n", locale);
53 printf("locale is now %s\n", actual_locale);
55 puts("before translation");
56 translation = dgettext(GETTEXT_PACKAGE, untranslated);
57 puts("after translation");
59 if (strcmp(expected, translation) != 0) {
60 fprintf(stderr, "# %s\n", N_("[DO_NOT_TRANSLATE_THIS_MARKER]"));
68 "Error: translation != expected\n",