mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 11:22:15 +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/>.
|
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
import basedir
|
||||||
import gettext
|
import gettext
|
||||||
import locale
|
import locale
|
||||||
import os
|
import os
|
||||||
|
@ -36,10 +37,10 @@ def init():
|
||||||
lang = locale.getdefaultlocale()
|
lang = locale.getdefaultlocale()
|
||||||
os.environ['LANG'] = lang[0]
|
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:
|
try:
|
||||||
translation = gettext.GNUTranslations(open( filename, "rb" ) )
|
translation = gettext.GNUTranslations(open(filename, "rb"))
|
||||||
except IOError:
|
except IOError:
|
||||||
translation = gettext.NullTranslations()
|
translation = gettext.NullTranslations()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue