]>
Commit | Line | Data |
---|---|---|
85b21051 | 1 | /* |
c9d3f842 | 2 | * "$Id$" |
85b21051 | 3 | * |
9e55d0dc | 4 | * Localization test program for the Common UNIX Printing System (CUPS). |
85b21051 | 5 | * |
24c1b5ce | 6 | * Copyright 1997-2006 by Easy Software Products. |
85b21051 | 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 | |
c9d3f842 | 18 | * Hollywood, Maryland 20636 USA |
85b21051 | 19 | * |
c4dcf3cc | 20 | * Voice: (301) 373-9600 |
85b21051 | 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> | |
a501ad17 | 36 | #include "i18n.h" |
85b21051 | 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 */ | |
66f81e44 | 48 | cups_lang_t *language2; /* Message catalog */ |
85b21051 | 49 | |
50 | ||
51 | if (argc == 1) | |
66f81e44 | 52 | { |
53 | language = cupsLangDefault(); | |
54 | language2 = cupsLangDefault(); | |
55 | } | |
85b21051 | 56 | else |
66f81e44 | 57 | { |
58 | language = cupsLangGet(argv[1]); | |
59 | language2 = cupsLangGet(argv[1]); | |
60 | } | |
61 | ||
62 | if (language != language2) | |
9e55d0dc | 63 | { |
66f81e44 | 64 | puts("**** ERROR: Language cache did not work! ****"); |
9e55d0dc | 65 | puts("First result from cupsLangGet:"); |
66 | } | |
85b21051 | 67 | |
68 | printf("Language = \"%s\"\n", language->language); | |
a501ad17 | 69 | printf("Encoding = \"%s\"\n", _cupsEncodingName(language->encoding)); |
70 | printf("No = \"%s\"\n", _cupsLangString(language, "No")); | |
71 | printf("Yes = \"%s\"\n", _cupsLangString(language, "Yes")); | |
85b21051 | 72 | |
9e55d0dc | 73 | if (language != language2) |
74 | { | |
75 | puts("Second result from cupsLangGet:"); | |
76 | ||
77 | printf("Language = \"%s\"\n", language2->language); | |
a501ad17 | 78 | printf("Encoding = \"%s\"\n", _cupsEncodingName(language2->encoding)); |
79 | printf("No = \"%s\"\n", _cupsLangString(language2, "No")); | |
80 | printf("Yes = \"%s\"\n", _cupsLangString(language2, "Yes")); | |
9e55d0dc | 81 | } |
82 | ||
85b21051 | 83 | return (0); |
84 | } | |
85 | ||
86 | ||
87 | /* | |
c9d3f842 | 88 | * End of "$Id$". |
85b21051 | 89 | */ |