fix(color): Lua scripts do not see selected language when using ALL_LANGS build (#6937)

This commit is contained in:
philmoz
2026-01-04 08:09:34 +10:00
committed by GitHub
parent 900ce6316e
commit d96ddbb8a7
2 changed files with 16 additions and 1 deletions
+8
View File
@@ -1758,7 +1758,15 @@ static int luaGetGeneralSettings(lua_State * L)
lua_pushtablenumber(L, "battMin", (90+g_eeGeneral.vBatMin) * 0.1f);
lua_pushtablenumber(L, "battMax", (120+g_eeGeneral.vBatMax) * 0.1f);
lua_pushtableinteger(L, "imperial", g_eeGeneral.imperial);
#if defined(ALL_LANGS)
char l[3];
l[0] = toupper(g_eeGeneral.ttsLanguage[0]);
l[1] = toupper(g_eeGeneral.ttsLanguage[1]);
l[2] = 0;
lua_pushtablestring(L, "language", l);
#else
lua_pushtablestring(L, "language", TRANSLATIONS);
#endif
lua_pushtablestring(L, "voice", currentLanguagePack->id);
lua_pushtableinteger(L, "gtimer", g_eeGeneral.globalTimer);
return 1;
+8 -1
View File
@@ -110,7 +110,14 @@ void LuaWidgetFactory::translateOptions(WidgetOption * options)
// No translations provided
if (!translateFunction) return;
auto lang = TRANSLATIONS;
#if defined(ALL_LANGS)
char lang[3];
lang[0] = toupper(g_eeGeneral.ttsLanguage[0]);
lang[1] = toupper(g_eeGeneral.ttsLanguage[1]);
lang[2] = 0;
#else
char* lang = TRANSLATIONS;
#endif
auto option = options;
while (option && option->name != nullptr) {