Skip to content

MiroTalk SFU Internationalization

MiroTalk SFU translates the in-room UI (buttons, tooltips, dialogs, and notifications). It does not translate the landing page or user-generated content such as chat messages.

Translation files live in public/lang/ (one JSON file per language). See the upstream translations README for the latest details.


Configuration

Set these parameters in your .env file:

Variable Default Description
UI_LANGUAGE en Default interface language code (for example en, es, fr)
UI_TRANSLATION_MODE google How translations are applied (see the modes below)

Example:

Text Only
UI_TRANSLATION_MODE=native
UI_LANGUAGE=es

You can also set the same values in config.ui.brand.app in app/src/config.js using the language and translationMode fields.

Mode Behavior
google (default) Use Google Translate and ignore the native JSON files
auto Use the native language file when available, otherwise fall back to Google Translate
native Use native files only. Missing translations stay in English

Language selection

Users can change the language and the translation mode in a room from Settings > Language. The choice is saved in the browser's local storage and reused in later rooms on the same browser.

The precedence is: browser override → server .env default. While testing configuration changes, reset the browser preference so the server default applies.


Supported languages

28 languages are available:

Code Language
en 🇬🇧 English
hu 🇭🇺 Magyar
es 🇪🇸 Español
fr 🇫🇷 Français
de 🇩🇪 Deutsch
pt 🇵🇹 Português
it 🇮🇹 Italiano
ru 🇷🇺 Русский
zh 🇨🇳 中文
ja 🇯🇵 日本語
ar 🇸🇦 العربية
hi 🇮🇳 हिन्दी
sr 🇷🇸 Srpski
id 🇮🇩 Bahasa Indonesia
ko 🇰🇷 한국어
tr 🇹🇷 Türkçe
nl 🇳🇱 Nederlands
bn 🇧🇩 বাংলা
ur 🇵🇰 اردو
vi 🇻🇳 Tiếng Việt
te 🇮🇳 తెలుగు
mr 🇮🇳 मराठी
ta 🇮🇳 தமிழ்
sw 🇹🇿 Kiswahili
fa 🇮🇷 فارسی
pl 🇵🇱 Polski
th 🇹🇭 ไทย
uk 🇺🇦 Українська

Missing or empty values fall back to English, so partial translations work.


Add or update a language

  1. Copy public/lang/en.json to public/lang/<language-code>.json (for example hu.json) if the file does not exist.
  2. Translate the values only. Keep the English keys, punctuation, casing, and placeholders such as {name} unchanged.
  3. For a new language, add its code, flag, and native name to LANG_DISPLAY in public/js/I18n.js.
  4. Set UI_TRANSLATION_MODE=native (or auto), select the language, and open a room to verify it.

Each file is grouped into namespaces:

Namespace UI content
tooltips Hover hints
buttons Button text, attributes, and dynamic menu captions
labels Static text, headings, and label attributes
dialogs Popup titles, text, buttons, and inputs
toasts Notifications

To exclude an HTML element from translation, add class="notranslate", translate="no", or data-i18n-skip.


Synchronize translation keys

After changing UI strings, run this from the repository root:

Bash
npm run lang

The script regenerates en.json and synchronizes the other language files. It keeps existing translations, preserves the key order of en.json, adds missing keys with English values, and removes stale keys. Review the diff and translate newly added English values before shipping.

Tip

Use literal messages in userLog() calls so the extractor can discover toast keys. For conditional messages, put each literal in its own branch.