forked from qt-creator/qt-creator
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>
This commit is contained in:
+6
-18
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user