Exemple #1
0
def gettranslations(base_dir, project_key, platform, **kwargs):
    """
    Download translation updates.

    Download updated translations from crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    localeTools.getTranslations(locale_config, basename, project_key)
Exemple #2
0
def setuptrans(base_dir, project_key, platform, **kwargs):
    """
    Set up translation languages.

    Set up translation languages for the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    localeTools.setupTranslations(locale_config, basename, project_key)
Exemple #3
0
def gettranslations(base_dir, project_key, platform, **kwargs):
    """
    Download translation updates.

    Download updated translations from crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    localeTools.getTranslations(locale_config, basename, project_key)
Exemple #4
0
def setuptrans(base_dir, project_key, platform, **kwargs):
    """
    Set up translation languages.

    Set up translation languages for the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    localeTools.setupTranslations(locale_config, basename, project_key)
Exemple #5
0
def uploadtrans(base_dir, project_key, platform, **kwargs):
    """
    Upload existing translations.

    Upload already existing translations to the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    for locale, locale_dir in locale_config['locales'].iteritems():
        if locale != locale_config['default_locale'].replace('_', '-'):
            localeTools.uploadTranslations(locale_config, metadata, locale_dir,
                                           locale, basename, project_key)
Exemple #6
0
def uploadtrans(base_dir, project_key, platform, **kwargs):
    """
    Upload existing translations.

    Upload already existing translations to the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    import buildtools.localeTools as localeTools
    for locale, locale_dir in locale_config['locales'].iteritems():
        if locale != locale_config['default_locale'].replace('_', '-'):
            localeTools.uploadTranslations(locale_config, metadata, locale_dir,
                                           locale, basename, project_key)
Exemple #7
0
def translate(base_dir, project_key, platform, **kwargs):
    """
    Update translation master files.

    Update the translation master files in the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    default_locale_dir = os.path.join(locale_config['base_path'],
                                      locale_config['default_locale'])

    import buildtools.localeTools as localeTools
    localeTools.updateTranslationMaster(locale_config, metadata,
                                        default_locale_dir, basename,
                                        project_key)
Exemple #8
0
def translate(base_dir, project_key, platform, **kwargs):
    """
    Update translation master files.

    Update the translation master files in the project on crowdin.com.
    """
    from buildtools.packager import readMetadata
    metadata = readMetadata(base_dir, platform)

    basename = metadata.get('general', 'basename')
    locale_config = read_locale_config(base_dir, platform, metadata)

    default_locale_dir = os.path.join(locale_config['base_path'],
                                      locale_config['default_locale'])

    import buildtools.localeTools as localeTools
    localeTools.updateTranslationMaster(locale_config, metadata,
                                        default_locale_dir, basename,
                                        project_key)