mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
add qt translations based on patch from Saturnien Zemlja
This commit is contained in:
parent
d594cf61e2
commit
a0ba32f263
1 changed files with 15 additions and 9 deletions
|
@ -80,6 +80,21 @@ def run():
|
|||
DeckStorage.backupDir = os.path.join(conf.configPath,
|
||||
"backups")
|
||||
|
||||
# qt translations
|
||||
translationPath = ''
|
||||
if 'linux' in sys.platform or 'unix' in sys.platform:
|
||||
translationPath = "/usr/share/qt4/translations/"
|
||||
if translationPath:
|
||||
long = conf['interfaceLang']
|
||||
if long == "ja_JP":
|
||||
# qt is inconsistent
|
||||
long = long.lower()
|
||||
short = long.split('_')[0]
|
||||
qtTranslator = QTranslator()
|
||||
if qtTranslator.load("qt_" + long, translationPath) or \
|
||||
qtTranslator.load("qt_" + short, translationPath):
|
||||
app.installTranslator(qtTranslator)
|
||||
|
||||
# load main window
|
||||
ui.importAll()
|
||||
ui.dialogs.registerDialogs()
|
||||
|
@ -90,15 +105,6 @@ def run():
|
|||
except (IOError, OSError):
|
||||
pass
|
||||
|
||||
# import platform
|
||||
# if (platform.processor() != "powerpc" and
|
||||
# platform.architecture()[0] == "32bit"):
|
||||
# try:
|
||||
# import psyco
|
||||
# psyco.profile()
|
||||
# except ImportError:
|
||||
# print "Installing python-psyco is strongly recommended."
|
||||
|
||||
app.exec_()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue