Growing

How to make a Telegram bot speak more than one language

By the Botable team

Telegram sends the user's app language with each update, which is a good default but a poor assumption. Store an explicit preference, keep every user-facing string in one place per language, and let users switch.

The short version

Making a Telegram bot multilingual is mostly a discipline problem rather than a technical one. Telegram includes the user's client language code in the data it sends, which is a reasonable default and a bad assumption — plenty of people run their phone in English and would rather read something else. So the pattern is: default from the language code, store an explicit preference the first time the user sets one, and offer a visible way to change it. The engineering half is keeping every user-facing string in a per-language table rather than inline in the handlers, because a bot with strings scattered through its logic cannot be translated without touching every file, and the ones that get missed are always the error messages. Machine translation is acceptable for chat replies and a real risk for anything legal or commercial, where a mistranslated refund policy is a dispute rather than a typo.

Step by step

How do you pick a starting language?

From the language code Telegram sends with the user's messages. Use it as the default, fall back to your primary language when it is one you do not support, and never treat it as final — it reflects the phone's setting, not necessarily a preference.

How should strings be organised?

In one place per language, keyed by a stable identifier, with the handlers looking up keys rather than containing text. Strings inline in the logic are why partially translated bots exist — the main flow gets done and the error paths do not.

How do users switch?

A /language command with buttons, stored per user id. Make it discoverable, because someone reading the wrong language cannot find a command they cannot read — putting it in the command menu with a globe emoji helps more than it sounds.

Where is machine translation risky?

Anywhere the wording carries obligation: terms, refunds, payment confirmations, safety instructions. Have those reviewed by a person. Conversational replies and help text tolerate machine translation well; a mistranslated refund window does not.

What catches people out

  • The language code is the phone's setting, not a preference — always allow an override
  • Untranslated error messages are the most common gap, because they are written last
  • Right-to-left languages affect layout in Mini Apps, not just the strings

Questions

Should the command menu be translated too?

Yes — setMyCommands accepts a language code, so the menu can be set per language. A translated bot with an English command menu looks half-finished, and that is the first thing a user sees.

How many languages is reasonable to start with?

Two. Every added language multiplies the maintenance of every future feature, and the second one already forces the structure that makes the tenth possible. Add more when the audience is demonstrably there.

Want a bot that does this?

Describe it in plain language and Botable writes the code, gives the bot its own database, deploys it and keeps it running. Everything on this page is handled for you — the token, the webhook, the storage, the hosting.

Build a bot

Keep reading

Bots that use this

All twenty-five guides