evg-2.5.9
توضیحات
Discord translator & translation of Discord functions/interactions
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | evg-2.5.9 |
| نام | evg |
| نسخه کتابخانه | 2.5.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Nikita Belan |
| ایمیل نویسنده | nikitabelan9@gmail.com |
| آدرس صفحه اصلی | https://github.com/IceOne-i/evg |
| آدرس اینترنتی | https://pypi.org/project/evg/ |
| مجوز | MIT |
## 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
```json
{
"hello1": "Hello world!",
"hello2": "Hello {name}!",
"hello3": "Hello {0}!"
}
```
### Base
```python
import evg
_ = evg.MSG("en-US").msg
print(_("hello1"))
```
* <b>Output text</b>: Hello world!
OR
```python
import evg
from nextcord import Interaction, PartialInteractionMessage
async def hi(ctx: Interaction) -> PartialInteractionMessage:
_ = evg.MSG(ctx.locale).msg
return await ctx.send(content=_("hello1"))
```
* <b>Output text</b>: Hello world!
OR
```python
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"))
```
<b>Output text</b>:
* Hello Nikita!
* Hello Bob!
### Change settings
#### Default language
```python
import evg
evg.Setup.language("en-US")
```
#### Default text if no translation was found
```python
import evg
evg.Setup.text("рџ’•")
```
## Support
[](https://discordapp.com/users/468846682843381760/) [](mailto:nikitabelan@gmail.com)
نحوه نصب
نصب پکیج whl evg-2.5.9:
pip install evg-2.5.9.whl
نصب پکیج tar.gz evg-2.5.9:
pip install evg-2.5.9.tar.gz