summaryrefslogtreecommitdiff
path: root/xclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'xclock.c')
-rw-r--r--xclock.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xclock.c b/xclock.c
index 9f637db..9091c57 100644
--- a/xclock.c
+++ b/xclock.c
@@ -46,6 +46,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/extensions/XKBbells.h>
#endif
+#ifndef NO_I18N
+#include <locale.h> /* for setlocale() */
+Boolean no_locale = True; /* if True, use old behavior */
+#endif
/* Command line options table. Only resources are entered here...there is a
pass over the remaining options after XtParseCommand is let loose. */
@@ -145,6 +149,18 @@ main(int argc, char *argv[])
Pixmap icon_pixmap = None;
XtAppContext app_con;
+#ifndef NO_I18N
+ char *locale_name = setlocale(LC_ALL,"");
+ XtSetLanguageProc ( NULL, NULL, NULL );
+
+ if(!locale_name || 0 == strcmp(locale_name,"C")) {
+ no_locale = True;
+ }
+ else {
+ no_locale = False;
+ }
+#endif
+
toplevel = XtOpenApplication(&app_con, "XClock",
options, XtNumber(options), &argc, argv, NULL,
sessionShellWidgetClass, NULL, ZERO);