]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/testlang.c
Update copyright notices, addresses, etc.
[thirdparty/cups.git] / cups / testlang.c
1 /*
2 * "$Id$"
3 *
4 * Localization test program for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2005 by Easy Software Products.
7 *
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
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * This file is subject to the Apple OS-Developed Software exception.
25 *
26 * Contents:
27 *
28 * main() - Load the specified language and show the strings for yes and no.
29 */
30
31 /*
32 * Include necessary headers...
33 */
34
35 #include <stdio.h>
36 #include "language.h"
37
38
39 /*
40 * 'main()' - Load the specified language and show the strings for yes and no.
41 */
42
43 int /* O - Exit status */
44 main(int argc, /* I - Number of command-line arguments */
45 char *argv[]) /* I - Command-line arguments */
46 {
47 cups_lang_t *language; /* Message catalog */
48 cups_lang_t *language2; /* Message catalog */
49 static const char * const charsets[] =/* Character sets */
50 {
51 "us-ascii",
52 "iso-8859-1",
53 "iso-8859-2",
54 "iso-8859-3",
55 "iso-8859-4",
56 "iso-8859-5",
57 "iso-8859-6",
58 "iso-8859-7",
59 "iso-8859-8",
60 "iso-8859-9",
61 "iso-8859-10",
62 "utf-8",
63 "iso8859-13",
64 "iso8859-14",
65 "iso8859-15",
66 "windows-874",
67 "windows-1250",
68 "windows-1251",
69 "windows-1252",
70 "windows-1253",
71 "windows-1254",
72 "windows-1255",
73 "windows-1256",
74 "windows-1257",
75 "windows-1258",
76 "koi8-r",
77 "koi8-u"
78 };
79
80
81 if (argc == 1)
82 {
83 language = cupsLangDefault();
84 language2 = cupsLangDefault();
85 }
86 else
87 {
88 language = cupsLangGet(argv[1]);
89 language2 = cupsLangGet(argv[1]);
90 }
91
92 if (language != language2)
93 {
94 puts("**** ERROR: Language cache did not work! ****");
95 puts("First result from cupsLangGet:");
96 }
97
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));
102
103 if (language != language2)
104 {
105 puts("Second result from cupsLangGet:");
106
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));
111 }
112
113 return (0);
114 }
115
116
117 /*
118 * End of "$Id$".
119 */