diff options
author | Eike Ziller <eike.ziller@digia.com> | 2012-12-06 11:59:04 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2012-12-06 12:28:50 +0100 |
commit | d0e055a1f2f8d10adeed5e490774313b91bf7a48 (patch) | |
tree | 01a2012f38c6cf2304d82d84f72347769383586a /scripts/deployqt.py | |
parent | 146ea4b240dbc3f70d17c85a9b651baee71cf7f1 (diff) | |
download | qt-creator-d0e055a1f2f8d10adeed5e490774313b91bf7a48.tar.gz |
Fix copying translations from Qt.
Qt5 splits the translations into modules as well. The deployqt
script was only copying specific translation patters from Qt,
now we just copy all .qm files from Qt to Qt Creator.
Change-Id: I02302e3f8f6b4673979559ce6cd2a32271b554a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'scripts/deployqt.py')
-rwxr-xr-x | scripts/deployqt.py | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/scripts/deployqt.py b/scripts/deployqt.py index d287c521d6..9b30f7de71 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -193,25 +193,14 @@ def add_qt_conf(install_dir): f.write('Libraries=../lib/qtcreator\n') f.close() -def copy_translations(install_dir, qt_tr_dir, tr_catalogs): - langs = [] +def copy_translations(install_dir, qt_tr_dir): + translations = glob(os.path.join(qt_tr_dir, '*.qm')) tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations') - p = re.compile(r'_(.*).qm') - for dirpath, dirnames, filenames in os.walk(tr_dir): - for filename in filenames: - if filename.endswith('.qm') and string.find(filename, 'qtcreator_') != -1: - lang = p.findall(filename) - if lang != '': - langs += lang print "copying translations..." - for lang in langs: - for catalog in tr_catalogs: - copy_file = "%s_%s.qm" % (catalog, lang) - copy_src = os.path.join(qt_tr_dir, copy_file) - copy_dst = os.path.join(tr_dir, copy_file) - print copy_src, '->', copy_dst - shutil.copy(copy_src, copy_dst) + for translation in translations: + print translation, '->', tr_dir + shutil.copy(translation, tr_dir) def readQmakeVar(qmake_bin, var): pipe = os.popen(' '.join([qmake_bin, '-query', var])) @@ -261,7 +250,6 @@ def main(): plugins = ['accessible', 'designer', 'iconengines', 'imageformats', 'platforms', 'printsupport', 'sqldrivers'] imports = ['Qt', 'QtWebKit'] - tr_catalogs = ['assistant', 'designer', 'qt', 'qt_help'] if sys.platform.startswith('win'): global debug_build @@ -271,7 +259,7 @@ def main(): copy_qt_libs(install_dir, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports) else: copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports) - copy_translations(install_dir, QT_INSTALL_TRANSLATIONS, tr_catalogs) + copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if not sys.platform.startswith('win'): fix_rpaths(chrpath_bin, install_dir) |