Fix fallback 'C' locale in ibus-setup.
authorfujiwarat <takao.fujiwara1@gmail.com>
Mon, 15 Oct 2012 02:45:30 +0000 (11:45 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Mon, 15 Oct 2012 02:45:30 +0000 (11:45 +0900)
BUG=RH#863673
TEST=Manually

Review URL: https://codereview.appspot.com/6649043

setup/main.py

index aed8c7d891424bc526f671e53f1734882b1b8787..f527da1ed3a8be79f7c5aec5792f2df5e4893be2 100644 (file)
@@ -549,7 +549,12 @@ class Setup(object):
         Gtk.main()
 
 if __name__ == "__main__":
-    locale.setlocale(locale.LC_ALL, '')
+    try:
+        locale.setlocale(locale.LC_ALL, '')
+    except locale.Error:
+        print >> sys.stderr, "Using the fallback 'C' locale"
+        locale.setlocale(locale.LC_ALL, 'C')
+
     i18n_init()
     setup = Setup()
     setup.run()