- Dicord interactions translator
- Optimization
- Easy to use
- 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
{
"hello1": "Hello world!",
"hello2": "Hello {name}!",
"hello3": "Hello {0}!"
}
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", name="Nikita")))
async def hi2(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(content=(_("hello3", "Bob")))
Output text:
- Hello Nikita!
- Hello Bob!
import evg
evg.Setup.language("en-US")
import evg
evg.Setup.text("💕")