A
A
Artem Rocky2018-05-17 20:31:26
Python
Artem Rocky, 2018-05-17 20:31:26

How to translate a telegram bot into several languages?

The essence of the question is this: how to check for the language in the bot code, in other words, if the user clicks on English, the entire text changes, and vice versa. I work with python and gettext. All files with translations are available, but how to use them in the code? I will be grateful

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Uno, 2018-05-18
@Noizefan

1. Store in the database the selected language for each user
2. Have separate translation files for each language
3. Check the user's language when he writes and, in accordance with it, send a specific phrase (I wrote my own syntax for them) in the current language.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question