1 /* Test program, used by the gettext-3 test.
2 Copyright (C) 2000, 2005, 2007 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* Contributed to the GNU C Library by
18 Thorsten Kukuk <kukuk@suse.de> and Andreas Jaeger <aj@suse.de>, 2000. */
28 /* Make sure we use the included libintl, not the system's one. */
30 #include "libgnuintl.h"
32 #define N_(string) string
36 const char *selection;
37 const char *description;
40 struct data_t strings[] =
42 { "String1", N_("First string for testing.") },
43 { "String2", N_("Another string for testing.") }
45 const int data_cnt = sizeof (strings) / sizeof (strings[0]);
47 const char *lang[] = { "de_DE", "fr_FR", "ll_CC" };
48 const int lang_cnt = sizeof (lang) / sizeof (lang[0]);
55 /* Clean up environment. */
56 unsetenv ("LANGUAGE");
58 unsetenv ("LC_MESSAGES");
59 unsetenv ("LC_CTYPE");
61 unsetenv ("OUTPUT_CHARSET");
63 textdomain ("tstlang");
65 for (i = 0; i < lang_cnt; ++i)
69 if (setlocale (LC_ALL, lang[i]) == NULL)
70 setlocale (LC_ALL, "C");
72 bindtextdomain ("tstlang", "gt-3");
74 for (j = 0; j < data_cnt; ++j)
75 printf ("%s - %s\n", strings[j].selection,
76 gettext (strings[j].description));