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:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user