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.
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)
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👍
Importing from botname doesn't make sense. Maybe that person created a dictionary in another file and imported that.
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.
Do you have code, that parses the yaml file? I don't think you can use "import" with yaml.
Yes, i have like this, English.yaml Hindi.yaml Jp.yaml
They're asking if you have a parser for yaml
Обсуждают сегодня