Skip to main content

A translation file finder used in Weblate.

Project description

Weblate

Weblate is a copylefted libre software web-based continuous localization system, used by over 1150 libre projects and companies in more than 115 countries.

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

Website Translation status CII Best Practices PyPI package Documentation

This library is used by Weblate to discover translation files in a cloned repository. It can operate on both file listings and actual filesystem. Filesystem access is needed for more accurate detection in some cases (detecting encoding or actual syntax of similar files).

Usage

In can be used from Python:

>>> from translation_finder import discover
>>> from pprint import pprint
>>> results = discover('translation_finder/test_data/')
>>> len(results)
22
>>> 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[11].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[11].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


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-2.5.tar.gz (68.5 kB view details)

Uploaded Source

Built Distribution

translation_finder-2.5-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

Details for the file translation-finder-2.5.tar.gz.

File metadata

  • Download URL: translation-finder-2.5.tar.gz
  • Upload date:
  • Size: 68.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for translation-finder-2.5.tar.gz
Algorithm Hash digest
SHA256 be72a555439fb59068ba5448b727a96129ec430cbf48133c2f0f51868603bdb2
MD5 b963b6274e19d6e44e321cafce53a8c0
BLAKE2b-256 c05184ccdece3dfcc990909c58dd0b4650897269495106d36a6baed0706608d6

See more details on using hashes here.

File details

Details for the file translation_finder-2.5-py3-none-any.whl.

File metadata

  • Download URL: translation_finder-2.5-py3-none-any.whl
  • Upload date:
  • Size: 80.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for translation_finder-2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 41d2a716efa55cdb8d7b49a00f53329d68cd145b81c2b705a549c94a2ca437fa
MD5 58a87956cd7261941f26407e4989b934
BLAKE2b-256 5d3b007a956267d9439b1aa6d4ccf9933970b381888cc60a16077cde1812112d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page