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 extension ".json" according to the template /locales/en-US/example.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(content=_("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(content=(_("hello2")).format(name="Nikita"))
async def hi2(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(content=(_("hello3")).format("Bob"))
Output text:
- Hello Nikita!
- Hello Bob!
Change settings
Default language
import evg
evg.Setup.language("en-US")
Default text if no translation was found
import evg
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.10.tar.gz
(2.9 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.10-py3-none-any.whl
(3.2 kB
view details)
File details
Details for the file evg-2.5.10.tar.gz.
File metadata
- Download URL: evg-2.5.10.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093e1d16c90aaf957fe9c17c1bc2a0f9412c77440fd94ea2fc38589e3c1e636a
|
|
| MD5 |
e668413c55dd3d1c6ad98b22b2b91368
|
|
| BLAKE2b-256 |
66213fb2212aa6528b6df3b052d970204962f6091d4de9ee2d3005319bd07728
|
File details
Details for the file evg-2.5.10-py3-none-any.whl.
File metadata
- Download URL: evg-2.5.10-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dabf79ae13f89d62b46af3a93cdf63fc1c1faf688bc4c3a4c7143a467dc9dae
|
|
| MD5 |
58d7ff3c2932426475ccf839124f75bb
|
|
| BLAKE2b-256 |
539eb797517fa0eb49d1951b9dd4e9104814f22d3451e0cfcd2ba6427d2c4211
|