From: Michael Tremer Date: Sat, 7 Oct 2017 11:17:31 +0000 (+0100) Subject: Properly load translation files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b5a3b4dbb3085eb7e6f41b10ba2c0b21aa447dc;p=pbs.git Properly load translation files Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index e7ee7763..b19f3352 100644 --- a/Makefile.am +++ b/Makefile.am @@ -456,7 +456,8 @@ substitutions = \ '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \ '|configsdir=$(configsdir)|' \ '|bindir=$(bindir)|' \ - '|datadir=$(datadir)|' + '|datadir=$(datadir)|' \ + '|localedir=$(localedir)|' SED_PROCESS = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ diff --git a/src/buildservice/constants.py.in b/src/buildservice/constants.py.in index 73d4b752..7d20ab23 100644 --- a/src/buildservice/constants.py.in +++ b/src/buildservice/constants.py.in @@ -5,8 +5,11 @@ import os.path # Import all constants from the pakfire module. from pakfire.constants import * +PACKAGE_NAME = "@PACKAGE_NAME@" + CONFIGSDIR = "@configsdir@" DATADIR = "@datadir@" +LOCALEDIR = "@localedir@" PAKFIRE_DIR = "/pakfire" PACKAGES_DIR = os.path.join(PAKFIRE_DIR, "packages") diff --git a/src/hub/__init__.py b/src/hub/__init__.py index 849208d5..0c722a3d 100644 --- a/src/hub/__init__.py +++ b/src/hub/__init__.py @@ -27,8 +27,7 @@ class Application(tornado.web.Application): ) # Load translations. - tornado.locale.load_gettext_translations( - os.path.join(BASEDIR, "translations"), "pakfire") + tornado.locale.load_gettext_translations(LOCALEDIR, PACKAGE_NAME) tornado.web.Application.__init__(self, **settings) diff --git a/src/web/__init__.py b/src/web/__init__.py index d077714c..c34ec552 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -98,8 +98,7 @@ class Application(tornado.web.Application): ) # Load translations. - tornado.locale.load_gettext_translations( - os.path.join(BASEDIR, "translations"), "pakfire") + tornado.locale.load_gettext_translations(LOCALEDIR, PACKAGE_NAME) tornado.web.Application.__init__(self, **settings)