summaryrefslogtreecommitdiff
path: root/cups/testlang.c
diff options
context:
space:
mode:
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-01-13 01:51:53 +0000
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-01-13 01:51:53 +0000
commitef416fc25c4af449e930416117bedb12fc9924ba (patch)
tree11f8aa8c5d3565a17d4a6d5121d3edba22e2a21e /cups/testlang.c
parent9ec11526e139aeacf6a052799a6aa22cbbe6ebb2 (diff)
downloadcups-ef416fc25c4af449e930416117bedb12fc9924ba.tar.gz
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/testlang.c')
-rw-r--r--cups/testlang.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/cups/testlang.c b/cups/testlang.c
new file mode 100644
index 000000000..f41408b03
--- /dev/null
+++ b/cups/testlang.c
@@ -0,0 +1,89 @@
+/*
+ * "$Id: testlang.c 4903 2006-01-10 20:02:46Z mike $"
+ *
+ * Localization test program for the Common UNIX Printing System (CUPS).
+ *
+ * Copyright 1997-2006 by Easy Software Products.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Easy Software Products and are protected by Federal
+ * copyright law. Distribution and use rights are outlined in the file
+ * "LICENSE.txt" which should have been included with this file. If this
+ * file is missing or damaged please contact Easy Software Products
+ * at:
+ *
+ * Attn: CUPS Licensing Information
+ * Easy Software Products
+ * 44141 Airport View Drive, Suite 204
+ * Hollywood, Maryland 20636 USA
+ *
+ * Voice: (301) 373-9600
+ * EMail: cups-info@cups.org
+ * WWW: http://www.cups.org
+ *
+ * This file is subject to the Apple OS-Developed Software exception.
+ *
+ * Contents:
+ *
+ * main() - Load the specified language and show the strings for yes and no.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include <stdio.h>
+#include "i18n.h"
+
+
+/*
+ * 'main()' - Load the specified language and show the strings for yes and no.
+ */
+
+int /* O - Exit status */
+main(int argc, /* I - Number of command-line arguments */
+ char *argv[]) /* I - Command-line arguments */
+{
+ cups_lang_t *language; /* Message catalog */
+ cups_lang_t *language2; /* Message catalog */
+
+
+ if (argc == 1)
+ {
+ language = cupsLangDefault();
+ language2 = cupsLangDefault();
+ }
+ else
+ {
+ language = cupsLangGet(argv[1]);
+ language2 = cupsLangGet(argv[1]);
+ }
+
+ if (language != language2)
+ {
+ puts("**** ERROR: Language cache did not work! ****");
+ puts("First result from cupsLangGet:");
+ }
+
+ printf("Language = \"%s\"\n", language->language);
+ printf("Encoding = \"%s\"\n", _cupsEncodingName(language->encoding));
+ printf("No = \"%s\"\n", _cupsLangString(language, "No"));
+ printf("Yes = \"%s\"\n", _cupsLangString(language, "Yes"));
+
+ if (language != language2)
+ {
+ puts("Second result from cupsLangGet:");
+
+ printf("Language = \"%s\"\n", language2->language);
+ printf("Encoding = \"%s\"\n", _cupsEncodingName(language2->encoding));
+ printf("No = \"%s\"\n", _cupsLangString(language2, "No"));
+ printf("Yes = \"%s\"\n", _cupsLangString(language2, "Yes"));
+ }
+
+ return (0);
+}
+
+
+/*
+ * End of "$Id: testlang.c 4903 2006-01-10 20:02:46Z mike $".
+ */