Translation files finder
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
scripts
translation_finder
.bettercodehub.yml
.gitignore
.gitmodules
.scrutinizer.yml
.travis.yml
CHANGES.rst
LICENSE
MANIFEST.in
README.rst
codecov.yml
requirements-test.txt
requirements.txt
setup.py
weblate-discovery

README.rst

translation-finder

A translation file finder for Weblate, translation tool with tight version control integration.

Build Status Code coverage Scrutinizer Code Quality Codacy Badge PyPI package

This library is used by Weblate to discover translation files in a cloned repository.

Usage

In can be used from Python:

>>> from translation_finder import discover
>>> discover('.')
[
    {
        "filemask": "locales/*/messages.po",
        "file_format": "po",
        "template": None,
    },
    {
        "filemask": "app/src/res/main/values-*/strings.xml",
        "file_format": "aresource",
        "template": "app/src/res/main/values/strings.xml",
    }
]

Or command line:

$ weblate-discovery translation_finder/test_data/
== Match 1 ==
file_format    : po
filemask       : locales/*.po

== Match 2 ==
file_format    : aresource
filemask       : app/src/res/main/values-*/strings.xml
template       : app/src/res/main/values/strings.xml