Exemplo n.º 1
0
def build_localizations():
    loc.compile_all_po("locale")
    build_qt_localizations()
    locale_dest = Path("build", "locale")
    if locale_dest.exists():
        shutil.rmtree(locale_dest)
    shutil.copytree("locale", locale_dest, ignore=shutil.ignore_patterns("*.po", "*.pot"))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
def build_localizations():
    loc.compile_all_po('locale')
    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'))
Exemplo n.º 4
0
def build_localizations(ui):
    loc.compile_all_po('locale')
    if ui == 'cocoa':
        app = cocoa_app()
        loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', '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'))
Exemplo n.º 5
0
def build_localizations(ui):
    loc.compile_all_po('locale')
    if ui == 'cocoa':
        app = cocoa_app()
        loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', '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'))
Exemplo n.º 6
0
def build_localizations():
    if not op.exists('locale'):
        os.symlink('dupeguru/locale', 'locale')
    loc.compile_all_po('locale')
    loc.generate_cocoa_strings_from_xib(op.join('cocoa', 'Base.lproj'))
    loc.localize_all_stringsfiles(op.join('cocoa', 'Base.lproj'), 'cocoa')
    loc.generate_cocoa_strings_from_xib(op.join('cocoalib', 'Base.lproj'))
    loc.localize_all_stringsfiles(op.join('cocoalib', 'Base.lproj'),
                                  'cocoalib')
    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'))
Exemplo n.º 7
0
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))
Exemplo n.º 8
0
def build_qt_localizations():
    loc.compile_all_po(op.join('qtlib', 'locale'))
    loc.merge_locale_dir(op.join('qtlib', 'locale'), 'locale')
Exemplo n.º 9
0
def build_qt_localizations():
    loc.compile_all_po(op.join("qtlib", "locale"))
    loc.merge_locale_dir(op.join("qtlib", "locale"), "locale")
Exemplo n.º 10
0
def build_qt_localizations():
    loc.compile_all_po(op.join('qtlib', 'locale'))
    loc.merge_locale_dir(op.join('qtlib', 'locale'), 'locale')
Exemplo n.º 11
0
def build_base_localizations():
    loc.compile_all_po('locale')
Exemplo n.º 12
0
def build_base_localizations():
    loc.compile_all_po('locale')
    loc.compile_all_po(op.join('hscommon', 'locale'))
    loc.merge_locale_dir(op.join('hscommon', 'locale'), 'locale')
Exemplo n.º 13
0
def build_base_localizations():
    loc.compile_all_po('locale')
    loc.compile_all_po(op.join('hscommon', 'locale'))
    loc.merge_locale_dir(op.join('hscommon', 'locale'), 'locale')
Exemplo n.º 14
0
def build_qt_localizations():
    loc.compile_all_po(op.join("qtlib", "locale"))
    loc.merge_locale_dir(op.join("qtlib", "locale"), "locale")
Exemplo n.º 15
0
def build_base_localizations():
    loc.compile_all_po("locale")