Repository navigation
Languages
Live language switching and translations.
Language switching is built in and works on the fly: the current language is a signal, so an open screen is translated immediately, without being recreated.
// 1. Translations: the mod's lang files (assets/<mod>/lang/en_us.json, ru_ru.json) are picked up automatically.
// You can also set them from code:
I18n.translations("en_us").add("mymod.clicks", "Clicks: %s");
I18n.translations("ru_ru").add("mymod.clicks", "Нажатий: %s");
I18n.declareLanguage("en_us"); // which languages to offer in the switcher
I18n.declareLanguage("ru_ru"); // (tables from code declare themselves)
// 2. Translated widgets; a signal argument is inserted and updates by itself.
Label.tr("mymod.clicks", clicks);
Button.tr("mymod.close").onPress(onClose);
new LanguageButton(); // ready button: next language in a cycle
// 3. Control from code.
I18n.setLanguage("ru_ru"); // own language, independent of the game's; the choice is saved
I18n.followGameLanguage(); // follow the game again (default behavior)- Lookup order: tables from code → custom sources (
I18n.addSource) → the game's lang files; if a key is missing in the current language,en_usis used, then the key itself. -
I18n.get(key, args)translates "now"; insideComputed/I18n.text(...)it is recomputed when the language changes. - Bindings are lazy (
Derived): a widget listens to the language only while it is in the tree, so there are no leaks. - The choice is stored in
config/luminaui.properties; a resource reload (F3+T, changing the game language) re-reads translations.
← HTML and CSS · English home · Config Screen →
Начало работы: Установка · Первый экран
Основы: Раскладка · Стили и темы · Цвета и градиенты · Анимации · Данные и сигналы · События и ввод
Виджеты: Каталог виджетов · Всплывающие окна · Формы · Markdown и книги
Игра: Инвентарь и слоты · Окна-контейнеры · Мобы, предметы и 3D · HUD · Карты
Оформление: Эффекты · Размытие, обрезка и GIF
HTML и CSS: HTML и CSS
Возможности: Языки · Экран настроек · Доступность и звуки
Для продвинутых: Расширение · Отладка и советы · Архитектура
Getting started: Installation · Your First Screen
Basics: Layout · Styles and Themes · Colors and Gradients · Animations · Data and Signals · Events and Input
Widgets: Widget Catalog · Popups · Forms · Markdown and Books
Game: Inventory and Slots · Container Screens · Mobs, Items and 3D · HUD Overlay · Maps
Visuals: Effects · Blur, Clipping and GIF
HTML and CSS: HTML and CSS
Features: Languages · Config Screen · Accessibility and Sounds
Advanced: Extending · Debugging and Tips · Architecture