def build_localizations(ui, edition): loc.compile_all_po('locale') if ui == 'cocoa': app = cocoa_app(edition) loc.build_cocoa_localizations(app, en_stringsfile=op.join( 'cocoa', 'base', 'en.lproj', 'Localizable.strings')) locale_dest = op.join(app.resources, 'locale') elif ui == 'qt': build_qt_localizations() locale_dest = op.join('build', 'locale') if op.exists(locale_dest): shutil.rmtree(locale_dest) shutil.copytree('locale', locale_dest, ignore=shutil.ignore_patterns('*.po', '*.pot')) if ui == 'qt' and not ISLINUX: print("Copying qt_*.qm files into the 'locale' folder") from PyQt5.QtCore import QLibraryInfo trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath) for lang in loc.get_langs('locale'): qmname = 'qt_%s.qm' % lang src = op.join(trfolder, qmname) if op.exists(src): copy(src, op.join('build', 'locale', qmname))
def build_localizations(): build_base_localizations() build_qt_localizations() locale_dest = op.join('build', 'locale') if op.exists(locale_dest): shutil.rmtree(locale_dest) shutil.copytree('locale', locale_dest, ignore=shutil.ignore_patterns('*.po', '*.pot')) if not ISLINUX: print("Copying qt_*.qm files into the 'locale' folder") from PyQt5.QtCore import QLibraryInfo trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath) for lang in loc.get_langs('locale'): qmname = 'qt_%s.qm' % lang src = op.join(trfolder, qmname) if op.exists(src): copy(src, op.join('build', 'locale', qmname))
def build_localizations(ui, edition): loc.compile_all_po('locale') if ui == 'cocoa': app = cocoa_app(edition) loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings')) locale_dest = op.join(app.resources, 'locale') elif ui == 'qt': build_qt_localizations() locale_dest = op.join('build', 'locale') if op.exists(locale_dest): shutil.rmtree(locale_dest) shutil.copytree('locale', locale_dest, ignore=shutil.ignore_patterns('*.po', '*.pot')) if ui == 'qt' and not ISLINUX: print("Copying qt_*.qm files into the 'locale' folder") from PyQt5.QtCore import QLibraryInfo trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath) for lang in loc.get_langs('locale'): qmname = 'qt_%s.qm' % lang src = op.join(trfolder, qmname) if op.exists(src): copy(src, op.join('build', 'locale', qmname))
def build_localizations(ui): build_base_localizations() if ui == "cocoa": app = cocoa_app() loc.build_cocoa_localizations(app) locale_dest = op.join(app.resources, "locale") elif ui == "qt": build_qt_localizations() locale_dest = op.join("build", "locale") if op.exists(locale_dest): shutil.rmtree(locale_dest) shutil.copytree("locale", locale_dest, ignore=shutil.ignore_patterns("*.po", "*.pot")) if ui == "qt" and not ISLINUX: print("Copying qt_*.qm files into the 'locale' folder") from PyQt5.QtCore import QLibraryInfo trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath) for lang in loc.get_langs("locale"): qmname = "qt_%s.qm" % lang src = op.join(trfolder, qmname) if op.exists(src): copy(src, op.join("build", "locale", qmname))