[meld] meld: Warn on broken locale settings and fall back to C
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] meld: Warn on broken locale settings and fall back to C
- Date: Fri, 18 Jul 2014 22:36:10 +0000 (UTC)
commit 2cd38f91ec85a095c28b5d444584f2dbf77ef3bf
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Jul 13 07:52:38 2014 +1000
meld: Warn on broken locale settings and fall back to C
bin/meld | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index b8f40fb..4fc49e6 100755
--- a/bin/meld
+++ b/bin/meld
@@ -83,7 +83,11 @@ locale_domain = meld.conf.__package__
locale_dir = meld.conf.LOCALEDIR
gettext.bindtextdomain(locale_domain, locale_dir)
-locale.setlocale(locale.LC_ALL, '')
+try:
+ locale.setlocale(locale.LC_ALL, '')
+except locale.Error as e:
+ print("Couldn't set the locale: %s; falling back to 'C' locale" % e)
+ locale.setlocale(locale.LC_ALL, 'C')
gettext.textdomain(locale_domain)
trans = gettext.translation(locale_domain, localedir=locale_dir, fallback=True)
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]