mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
bundle qt translations
This commit is contained in:
parent
d469428471
commit
df6f79fcc3
2 changed files with 8 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
||||||
*\#
|
*\#
|
||||||
*~
|
*~
|
||||||
/aqt/forms
|
/aqt/forms
|
||||||
|
/aqt/locale
|
||||||
|
|
|
@ -87,15 +87,13 @@ def run():
|
||||||
pm = ProfileManager(opts.base, opts.profile)
|
pm = ProfileManager(opts.base, opts.profile)
|
||||||
|
|
||||||
# qt translations
|
# qt translations
|
||||||
translationPath = ''
|
qtTranslator = QTranslator()
|
||||||
if False: # not isWin and not isMac:
|
languageDir = os.path.join(moduleDir, "aqt", "locale")
|
||||||
translationPath = "/usr/share/qt4/translations/"
|
if not os.path.exists(languageDir):
|
||||||
long = conf['interfaceLang']
|
languageDir = os.path.join(
|
||||||
short = long.split('_')[0]
|
os.path.dirname(sys.argv[0]), "locale")
|
||||||
qtTranslator = QTranslator()
|
if qtTranslator.load("qt_" + pm.meta['defaultLang'], languageDir):
|
||||||
if qtTranslator.load("qt_" + long, translationPath) or \
|
app.installTranslator(qtTranslator)
|
||||||
qtTranslator.load("qt_" + short, translationPath):
|
|
||||||
app.installTranslator(qtTranslator)
|
|
||||||
|
|
||||||
import aqt.main
|
import aqt.main
|
||||||
mw = aqt.main.AnkiQt(app, pm)
|
mw = aqt.main.AnkiQt(app, pm)
|
||||||
|
|
Loading…
Reference in a new issue