mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-12-22 13:42:14 +01:00
The translation files are now found regardless of the current directory.
It was previously only working if gitinspector was executed from the base directory.
This commit is contained in:
parent
0923547947
commit
017f63e98a
1 changed files with 3 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import basedir
|
||||
import gettext
|
||||
import locale
|
||||
import os
|
||||
|
@ -36,10 +37,10 @@ def init():
|
|||
lang = locale.getdefaultlocale()
|
||||
os.environ['LANG'] = lang[0]
|
||||
|
||||
filename = "translations/messages_%s.mo" % lang[0][0:2]
|
||||
filename = basedir.get_basedir() + "/translations/messages_%s.mo" % lang[0][0:2]
|
||||
|
||||
try:
|
||||
translation = gettext.GNUTranslations(open( filename, "rb" ) )
|
||||
translation = gettext.GNUTranslations(open(filename, "rb"))
|
||||
except IOError:
|
||||
translation = gettext.NullTranslations()
|
||||
|
||||
|
|
Loading…
Reference in a new issue