I just want to ask if someone can explain for

me, i want to add some language switch features in my bot,

I'm just beginners and also slow understanding..
How can i add all string(language words) from all modules?

If someone can explain or can give me some tutorial, it will help me alot...

Thanks in advance.

7 ответов

12 просмотров

Usually you create one (or more) translation file for every language. I think there are libraries for it, but I never used them. Maybe someone else has experience. However, the bot can read the preferred user language from the User object. (property "from" of Message object)

Quad
Usually you create one (or more) translation file ...

I saw some bot have like this feauture, but Frankly without tutorial i can't understand 😅 Someone import language like this From botname import language as gs From botname import language as tld Like this.. Without some tutorial i can't understand, i try to do like this.. 5 or 10 time my bot always crash. Anyway Thanks you👍

𝓝𝓲𝓬𝓴𝔂 𝓛𝓪𝓵𝓻𝓸𝓬𝓱𝓱𝓪𝓻𝓪
I saw some bot have like this feauture, but Frankl...

Importing from botname doesn't make sense. Maybe that person created a dictionary in another file and imported that.

Quad
Importing from botname doesn't make sense. Maybe t...

Yes..i was doing same, I create folder for language yaml file.. And i write new line inside all modules... Like this from botname import.project.languages I think i don't know how it's work, to fix this or to make some code for this.

𝓝𝓲𝓬𝓴𝔂 𝓛𝓪𝓵𝓻𝓸𝓬𝓱𝓱𝓪𝓻𝓪
Yes..i was doing same, I create folder for languag...

Do you have code, that parses the yaml file? I don't think you can use "import" with yaml.

Quad
Do you have code, that parses the yaml file? I don...

Yes, i have like this, English.yaml Hindi.yaml Jp.yaml

Похожие вопросы

Карта сайта