Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do telegram determine user language

API object User has property language_code - how do Telegram determine user's language, and how do I change it?

I wish to create response for user based on language_code language, but I am not sure I can trust this value, because fore example my language_code is 'en', but for the chatting or UI I am using another one!

like image 789
Valera Kvip Avatar asked Jul 31 '26 04:07

Valera Kvip


1 Answers

Each Update from Telegram contains User information (in Message, in InlineQuery or some other). This language_code is based on which language is set as default on user's device or set for Telegram app. You can trust it.

But some users may want to change a language just for your bot. For that you can add your custom "Settings" to your bot menu, with all languages you support.

like image 153
wowkin2 Avatar answered Aug 05 '26 20:08

wowkin2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!