[pitivi/1.0] bin: Don't bother with the locale module



commit 8d13472ae437d7d23416f81d4b17a4828494cf89
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Feb 13 23:36:32 2018 +0100

    bin: Don't bother with the locale module
    
    The gnome-* apps respect LC_ALL and so should we.
    
    Only the Pitivi Python layer uses the "pitivi" gettext domain.
    The C libs we use don't need access to it, we're safe using only the
    gettext module as described by:
    https://docs.python.org/3/library/locale.html#access-to-message-catalogs
    
    Differential Revision: https://phabricator.freedesktop.org/D1955

 bin/pitivi.in |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/bin/pitivi.in b/bin/pitivi.in
index 2ea156d..2e3420a 100755
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -19,7 +19,6 @@
 # Boston, MA 02110-1301, USA.
 import cProfile
 import gettext
-import locale
 import os
 import signal
 import sys
@@ -94,17 +93,11 @@ def _add_pitivi_path():
         if path not in sys.path:
             sys.path.append(path)
 
-    # Added for i18n
+    # i18n
     localedir = os.path.join(DATADIR, "locale")
     try:
-        locale.setlocale(locale.LC_ALL, '')
-        locale.bindtextdomain('pitivi', localedir)
-        locale.textdomain('pitivi')
-    except Exception as e:
-        print("Couldn't set locale.", localedir, e)
-    try:
-        gettext.bindtextdomain('pitivi', localedir)
-        gettext.textdomain('pitivi')
+        gettext.bindtextdomain("pitivi", localedir)
+        gettext.textdomain("pitivi")
     except Exception as e:
         print("Couldn't set the gettext domain. Translations will not work.", localedir, e)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]