Skip to main content

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

Discord Gmail

Project details


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 hashes)

Uploaded Source

Built Distribution

evg-2.5.10-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page