A translation file finder for Weblate, translation tool with tight version control integration
Project description
A translation file finder for Weblate, translation tool with tight version control integration.
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
>>> from pprint import pprint
>>> results = discover('translation_finder/test_data/')
>>> len(results)
11
>>> pprint(results[0].match)
{'file_format': 'aresource',
'filemask': 'app/src/res/main/values-*/strings.xml',
'name': 'android',
'template': 'app/src/res/main/values/strings.xml'}
>>> pprint(results[5].match)
{'file_format': 'po',
'filemask': 'locales/*.po',
'new_base': 'locales/messages.pot'}
Additional information about discovery can be obtained from meta attribute:
>>> pprint(results[0].meta)
{'discovery': 'TransifexDiscovery', 'origin': 'Transifex', 'priority': 500}
>>> pprint(results[5].meta)
{'discovery': 'GettextDiscovery', 'origin': None, 'priority': 1000}
Or command line:
$ weblate-discovery translation_finder/test_data/
== Match 1 (Transifex) ==
file_format : aresource
filemask : app/src/res/main/values-*/strings.xml
name : android
template : app/src/res/main/values/strings.xml
...
== Match 7 ==
file_format : po
filemask : locales/*.po
new_base : locales/messages.pot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
translation-finder-1.4.tar.gz
(28.8 kB
view details)
Built Distribution
File details
Details for the file translation-finder-1.4.tar.gz
.
File metadata
- Download URL: translation-finder-1.4.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c95b22affad76968d1b1823ff6cd5a8ba477feabb1fb03858c7405a8e7c6477 |
|
MD5 | b705795c6dcd580ae92e472d37332134 |
|
BLAKE2b-256 | dc1a43fb4dc76b674c993fd7597f6ca079dd57cc299ca0e6a6979b04e853d591 |
File details
Details for the file translation_finder-1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: translation_finder-1.4-py2.py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25c476f8289f4c9a4aba3525dada2d011bc3d94414983330a254fdbdd5c5f62 |
|
MD5 | 297853b28ca104a67b0f0c82fd6b469c |
|
BLAKE2b-256 | dc1ff10a3d4cf1c1afab6d24c08237e04098cc360563edd5968ad0a1578ff0fc |