Installation
pip install geranslator
Configuration
.geranslator-config.yaml
It's gonna be created for you. 😌
geranslator:
lang_dir: lang
lang_files_ext: json
provider: google
origin_lang: en
target_langs: [fr, ar]
- lang_dir: Where your translation files live.
- lang_files_ext: Your translation files extension.
- provider: Provider you want to translate your file.
- origin_lang: The origin language you already have.
- target_langs: Languages you want your file to get translated to.
supported extensions: json, yaml, yml, po
supported providers: google, deepl
Usage
CLI
geranslator
Supported options
| option | short | description |
|---|---|---|
| --provider | -p | To specify provider. |
| --lang-dir | -d | To specify translation files directory. |
| --extension | -e | To specify translation files format. |
| --origin-lang | -o | To specify the origin language. |
| --target-langs | -t | To specify target languages. |
geranslator --provider=deepl --origin-lang=en --target-langs=es,pt
geranslator -p deepl -o en -t es,pt
IDE
This will use the configuration as default
from geranslator import Geranslator
Geranslator().translate()
You can customize it using the following methods. 😃
from geranslator import Geranslator
geranslator = Geranslator()
geranslator.set_provider('google')
geranslator.set_lang_dir('translation')
geranslator.set_origin_lang('en')
geranslator.set_target_lang(['ar', 'fr'])
geranslator.set_lang_files_extension('json')
geranslator.translate()
You can chain them too 😮
from geranslator import Geranslator
Geranslator().set_provider('google').set_lang_dir('translation').set_origin_lang('en').set_target_lang(['ar', 'fr']).set_lang_files_extension('json').translate()
Metadata
Release files for geranslator 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geranslator-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for geranslator-2.0.3-py3-none-any.whl |
Release files / geranslator-2.0.3-py3-none-any.whl
| Download URL | geranslator-2.0.3-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbc1ceb12a2eb963993213720a16f05d2211f8ec7c577c0a7ca3640cd18b85d7
|
|
BLAKE2b-256 checksum How to use checksums |
088c3614d11322e5bd22ec56330ed9f8abd8d8d8f15cc8942326e90952c9db53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for geranslator 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.