Discord translator & translation of Discord functions/interactions
Project description
Features
- Dicord Interactions Translator
- Optimization
- Easy to use
Installation
- Install evg with pip
pip install evg
- Set up a new folder /locales
- Add language packs with the file .json according to the template /locales/en-US/.json
Examples
File - locales/en-US/example.json
{
"hello1": "Hello world!",
"hello2": "Hello {name}!",
"hello3": "Hello {0}!"
}
Base
import evg
_ = evg.MSG("en-US").msg
print(_("hello1"))
- Output text: Hello world!
OR
import evg
from nextcord import Interaction, PartialInteractionMessage
async def hi(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(text=_("hello1"))
- Output text: Hello world! OR
import evg
from nextcord import Interaction, PartialInteractionMessage
async def hi(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(text=(_("hello2")).format(name="Nikita"))
async def hi2(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(text=(_("hello3")).format("Bob"))
Output text:
- Hello Nikita!
- Hello Bob!
Change settings
Default language
evg.Setup.language("en-US")
Default text if no translation was found
evg.Setup.text("рџ’•")
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
evg-2.5.5.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
evg-2.5.5-py3-none-any.whl
(3.1 kB
view details)
File details
Details for the file evg-2.5.5.tar.gz.
File metadata
- Download URL: evg-2.5.5.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf2d86817793511247cb0508c5553cbb23ccc8b2d867d96a757c056b4ab8135
|
|
| MD5 |
e9902dc40a70ff97c4d72043df37d904
|
|
| BLAKE2b-256 |
6ce19b56b0385891f881f154a4e0ab09d00ac8e560cd0c1d8b5c079c1d48c817
|
File details
Details for the file evg-2.5.5-py3-none-any.whl.
File metadata
- Download URL: evg-2.5.5-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17c9a562e17b652b879d3a02b4111e9c6fe0e5b97dd7006f4efdbc79f4adf8b6
|
|
| MD5 |
461e5a556f022696a8aa4dc0b93c3cfa
|
|
| BLAKE2b-256 |
23b18a177f64c41763c1bc9ccf9cf91e90ef39483fec986f413fe5b209481501
|