Translation directory for OSX bundles

Addresses bitmessage#514
This commit is contained in:
mailchuck 2015-11-11 02:42:03 +01:00
parent 23b8811add
commit df54bbad81
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -67,11 +67,13 @@ def _translate(context, text):
def change_translation(locale):
global qtranslator
qtranslator = QtCore.QTranslator()
translationpath = os.path.join(
getattr(sys, '_MEIPASS', sys.path[0]),
'translations',
'bitmessage_' + locale
)
if shared.frozen == "macosx_app":
translationpath = os.environ.get("RESOURCEPATH")
elif shared.frozen: # windows
translationpath = sys._MEIPASS
else:
translationpath = os.path.dirname(os.path.dirname(__file__))
translationpath = os.path.join (translationpath, 'translations', 'bitmessage_' + locale)
qtranslator.load(translationpath)
QtGui.QApplication.installTranslator(qtranslator)