1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 19:40:21 +01:00

Added fallback to C if there is no suitable locales

This commit is contained in:
2009-05-19 19:50:46 +00:00
parent f0f8d27d19
commit 7b5c76f1d9

View File

@@ -21,7 +21,11 @@ GETTEXT_DOMAIN = 'pygtktalog'
LOCALE_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), LOCALE_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'locale') 'locale')
try:
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
except locale.Error:
# unknown locale string, fallback to C
locale.setlocale(locale.LC_ALL, 'C')
for module in gtk.glade, gettext: for module in gtk.glade, gettext:
if os.path.exists(LOCALE_PATH): if os.path.exists(LOCALE_PATH):