[gnome-music/wip/merge: 332/343] Load gettext on startup
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/merge: 332/343] Load gettext on startup
- Date: Thu, 25 Jul 2013 11:40:22 +0000 (UTC)
commit 7dce8a0e17e35060a6288049efcacf05c2167462
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Tue Jul 23 23:57:57 2013 +0800
Load gettext on startup
Initialize gettext of C library and Python gettext module.
Makefile.am | 1 +
gnome-music.in | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index ab9f1e1..a0d0cca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,6 +54,7 @@ gnome-music: gnome-music.in
-e s!\ libexecdir\@!$(libexecdir)! \
-e s!\ libdir\@!$(libdir)! \
-e s!\ pkglibdir\@!$(pkglibdir)! \
+ -e s!\ localedir\@!$(localedir)! \
-e s!\ pythondir\@!$(pythondir)! \
-e s!\ pyexecdir\@!$(pyexecdir)! \
-e s!\ PACKAGE\@!$(PACKAGE)! \
diff --git a/gnome-music.in b/gnome-music.in
index 585daed..cf2f1f4 100644
--- a/gnome-music.in
+++ b/gnome-music.in
@@ -1,11 +1,12 @@
#!/usr/bin/env python3
-import sys, signal, os
+import sys, signal, os, locale, gettext
sys.path.insert(1, '@pyexecdir@')
from gi.repository import Gio, Gtk
import gnomemusic
+localedir='@localedir@'
srcdir = os.path.abspath(os.path.join(os.path.dirname(gnomemusic.__file__), '..'))
if os.path.exists(os.path.join(srcdir, 'gnome-music.doap')):
print('Running from source tree, using local files')
@@ -40,6 +41,11 @@ def install_excepthook():
if __name__ == "__main__":
install_excepthook()
+ locale.bindtextdomain('gnome-music', localedir)
+ locale.textdomain('gnome-music')
+ gettext.bindtextdomain('gnome-music', localedir)
+ gettext.textdomain('gnome-music')
+
resource = Gio.resource_load(os.path.join(pkgdatadir, 'gnome-music.gresource'))
Gio.Resource._register(resource)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]