Skip to main content

A translation file finder used in Weblate.

Reason this release was yanked:

broken files discovery

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)
25
>>> 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[13].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[13].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.8.tar.gz (69.6 kB view details)

Uploaded Source

Built Distribution

translation_finder-2.8-py3-none-any.whl (82.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: translation-finder-2.8.tar.gz
  • Upload date:
  • Size: 69.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for translation-finder-2.8.tar.gz
Algorithm Hash digest
SHA256 ed23ea052b9c6c657a50d57b7b162ed8715959c6c19964947f81454f09383987
MD5 3944f9faabea7cd1bbcfb33facfaad4e
BLAKE2b-256 0857d756305578f65967c06300219b8f40402c22654791bb7806ad56925f9a30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: translation_finder-2.8-py3-none-any.whl
  • Upload date:
  • Size: 82.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for translation_finder-2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 031fa4f2d60546050dec7aded683ab9312c21c24428e85ed2fe5c45761608a20
MD5 2774ef5b5450bb94aa05afe00bc9ebe3
BLAKE2b-256 9523f9f6552e3831dc52e5bc3fd90ae91a2da0ad871abc4cdce9a7952226966b

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