]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testlang.c
4 * Localization test program for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2005 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
28 * main() - Load the specified language and show the strings for yes and no.
32 * Include necessary headers...
40 * 'main()' - Load the specified language and show the strings for yes and no.
43 int /* O - Exit status */
44 main(int argc
, /* I - Number of command-line arguments */
45 char *argv
[]) /* I - Command-line arguments */
47 cups_lang_t
*language
; /* Message catalog */
48 cups_lang_t
*language2
; /* Message catalog */
49 static const char * const charsets
[] =/* Character sets */
83 language
= cupsLangDefault();
84 language2
= cupsLangDefault();
88 language
= cupsLangGet(argv
[1]);
89 language2
= cupsLangGet(argv
[1]);
92 if (language
!= language2
)
94 puts("**** ERROR: Language cache did not work! ****");
95 puts("First result from cupsLangGet:");
98 printf("Language = \"%s\"\n", language
->language
);
99 printf("Encoding = \"%s\"\n", charsets
[language
->encoding
]);
100 printf("No = \"%s\"\n", cupsLangString(language
, CUPS_MSG_NO
));
101 printf("Yes = \"%s\"\n", cupsLangString(language
, CUPS_MSG_YES
));
103 if (language
!= language2
)
105 puts("Second result from cupsLangGet:");
107 printf("Language = \"%s\"\n", language2
->language
);
108 printf("Encoding = \"%s\"\n", charsets
[language2
->encoding
]);
109 printf("No = \"%s\"\n", cupsLangString(language2
, CUPS_MSG_NO
));
110 printf("Yes = \"%s\"\n", cupsLangString(language2
, CUPS_MSG_YES
));