fix(color): Lua scripts do not see selected language when using ALL_LANGS build (#6937)
This commit is contained in:
@@ -1758,7 +1758,15 @@ static int luaGetGeneralSettings(lua_State * L)
|
|||||||
lua_pushtablenumber(L, "battMin", (90+g_eeGeneral.vBatMin) * 0.1f);
|
lua_pushtablenumber(L, "battMin", (90+g_eeGeneral.vBatMin) * 0.1f);
|
||||||
lua_pushtablenumber(L, "battMax", (120+g_eeGeneral.vBatMax) * 0.1f);
|
lua_pushtablenumber(L, "battMax", (120+g_eeGeneral.vBatMax) * 0.1f);
|
||||||
lua_pushtableinteger(L, "imperial", g_eeGeneral.imperial);
|
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);
|
lua_pushtablestring(L, "language", TRANSLATIONS);
|
||||||
|
#endif
|
||||||
lua_pushtablestring(L, "voice", currentLanguagePack->id);
|
lua_pushtablestring(L, "voice", currentLanguagePack->id);
|
||||||
lua_pushtableinteger(L, "gtimer", g_eeGeneral.globalTimer);
|
lua_pushtableinteger(L, "gtimer", g_eeGeneral.globalTimer);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -110,7 +110,14 @@ void LuaWidgetFactory::translateOptions(WidgetOption * options)
|
|||||||
// No translations provided
|
// No translations provided
|
||||||
if (!translateFunction) return;
|
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;
|
auto option = options;
|
||||||
while (option && option->name != nullptr) {
|
while (option && option->name != nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user