Fancy Translator
This library allow you to run setup a translator with ease. Just provide it the translations files and access them when ever you need them
Having an issue?
You can always find someone on our discord server here:
Wiki
The official wiki of this library will be available at GitHub
How to install
To install just use following command
pip install PyFancyTranslator
This library will have dev/beta builds on the GitHub, to install them you can use
pip install --upgrade git+https://github.com/AGM-Studio/FancyTranslator.git
Example
from FancyTranslator import Translator
# All language files must be in .ini format and be placed in a folder to be accessed
translator = Translator("./translations/")
# To access a language with name "en.ini" just call the method below
language = translator.get('en')
# To get a translation for "MyKey" in section "MySection"
translation = language.translate("MySection", "MyKey")
# To use placeholder:
class MyClass:
def __init__(self, obj):
self.obj = obj
my_class = MyClass({"name": "Nested"})
# In file: "This is an example with a normal placeholder: %%value%%"
trans1 = translator.get('en').translate("Target", "trans1", value="My Value")
# returns "This is an example with a normal placeholder: My Value"
# In file: "This is an example with a nested placeholder: %%nested.obj.name%%"
trans2 = translator.get('en').translate("Target", "trans2", nested=my_class)
# returns "This is an example with a nested placeholder: Nested"
Metadata
Release files for pyfancytranslator 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyfancytranslator-1.1.1.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyfancytranslator-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / pyfancytranslator-1.1.1.tar.gz
| Download URL | pyfancytranslator-1.1.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
980a2a4253799d2603f7ac86cfc331a7aff5209abaf248646055c9a1a309c2c5
|
|
BLAKE2b-256 checksum How to use checksums |
fbf65d0e62fa5dcfc760a4ee6901f71e4b9a55e115328b353a0a5d669289ba27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pyfancytranslator-1.1.1-py3-none-any.whl
| Download URL | pyfancytranslator-1.1.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6f8c0ecd9d3d9214e51426e5ac318556aab43b4350586a7a1355c9c41b81ff1
|
|
BLAKE2b-256 checksum How to use checksums |
439d7bf3254092363902c7a1b2f254aea6849c2011f76b12236616366c6b9207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for pyfancytranslator 1.1.1
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.