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)
9
>>> pprint(results[0])
{'file_format': 'aresource',
'filemask': 'app/src/res/main/values-*/strings.xml',
'name': 'android',
'template': 'app/src/res/main/values/strings.xml'}
>>> pprint(results[5])
{'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.3.tar.gz
(29.5 kB
view hashes)
Built Distribution
Close
Hashes for translation_finder-1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d32789e3cc3f2a6ea057a618eacf186cb90d59815f751509492e7e56266c404a |
|
MD5 | d98167569e91efcc961702e478055518 |
|
BLAKE2b-256 | 0d9ea1ac8fab8b41dc815ed1b6944a8d1a42c4cbab598b87030c9bf96e573270 |