Commit 2f9d938a authored by Alexandru Băluț's avatar Alexandru Băluț

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
parent 084612cb
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment