Skip to main content

A translation file finder used in Weblate.

Project description

Weblate

Weblate is libre software web-based continuous localization system, used by over 2500 libre projects and companies in more than 165 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)
40
>>> 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[1].match)
{'file_format': 'po',
 'filemask': 'locales/*.po',
 'name': 'translation',
 '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[22].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-3.2.1.tar.gz (98.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translation_finder-3.2.1-py3-none-any.whl (109.4 kB view details)

Uploaded Python 3

File details

Details for the file translation_finder-3.2.1.tar.gz.

File metadata

  • Download URL: translation_finder-3.2.1.tar.gz
  • Upload date:
  • Size: 98.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for translation_finder-3.2.1.tar.gz
Algorithm Hash digest
SHA256 c7aa06ea5654913691e8ae16c67fdacf181f7d31f09a60def5c85026c6435496
MD5 6d7fd5724654e91ecd55b33c89ada92d
BLAKE2b-256 db44942a90828263491ffbda08943267f1277048b26f26aa4078871cf6dcb262

See more details on using hashes here.

File details

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

File metadata

  • Download URL: translation_finder-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 109.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for translation_finder-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d79a336938a20cad307e6d3f2d0df0ac146cd12a58cbef2dfdc8268c455c90b5
MD5 fc7b8d6fafbe8ea1b63ada57add0c333
BLAKE2b-256 2ec510977be8cceb407bbf3d6e82b50aff2c27fb479fcb141fca1e5dd0d5ead3

See more details on using hashes here.

Supported by

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