lang: convertits els fitxers de text a json

This commit is contained in:
2025-06-06 23:59:27 +02:00
parent 2512345b2c
commit 767d38e170
22 changed files with 26093 additions and 1367 deletions

View File

@@ -30,10 +30,10 @@ namespace globalInputs
{
// Si la notificación de salir no está activa, muestra la notificación
#ifdef ARCADE
const int INDEX = code == section::Options::QUIT_WITH_CONTROLLER ? 116 : 94;
Notifier::get()->show({lang::getText(INDEX), std::string()}, -1, CODE);
const std::string TEXT = code == section::Options::QUIT_WITH_CONTROLLER ? lang::getText("NOTIFICATIONS_116") : lang::getText("NOTIFICATIONS_94");
Notifier::get()->show(TEXT, std::string()}, -1, CODE);
#else
Notifier::get()->show({lang::getText(94), std::string()}, -1, CODE);
Notifier::get()->show({lang::getText("NOTIFICATIONS_94"), std::string()}, -1, CODE);
#endif
}
}
@@ -45,11 +45,11 @@ namespace globalInputs
if (Notifier::get()->checkCode(CODE))
{
section::name = section::Name::INIT;
Notifier::get()->show({lang::getText(111)});
Notifier::get()->show({lang::getText("HELP_111")});
}
else
{
Notifier::get()->show({lang::getText(125), std::string()}, -1, CODE);
Notifier::get()->show({lang::getText("NOTIFICATIONS_125"), std::string()}, -1, CODE);
}
}
@@ -65,21 +65,21 @@ namespace globalInputs
void toggleIntegerScale()
{
Screen::get()->toggleIntegerScale();
Notifier::get()->show({lang::getText(134) + " " + boolToOnOff(options.video.integer_scale)});
Notifier::get()->show({lang::getText("MISC_134") + " " + boolToOnOff(options.video.integer_scale)});
}
// Activa / desactiva el vsync
void toggleVSync()
{
Screen::get()->toggleVSync();
Notifier::get()->show({lang::getText(136) + " " + boolToOnOff(options.video.v_sync)});
Notifier::get()->show({lang::getText("MISC_136") + " " + boolToOnOff(options.video.v_sync)});
}
// Activa o desactiva los shaders
void toggleShaders()
{
Screen::get()->toggleShaders();
Notifier::get()->show({lang::getText(135) + " " + boolToOnOff(options.video.shaders)});
Notifier::get()->show({lang::getText("MISC_135") + " " + boolToOnOff(options.video.shaders)});
}
// Obtiene una fichero a partir de un lang::Code
@@ -87,14 +87,14 @@ namespace globalInputs
{
switch (code)
{
case lang::Code::ba_BA:
return Asset::get()->get("ba_BA.txt");
case lang::Code::VALENCIAN:
return Asset::get()->get("ba_BA.json");
break;
case lang::Code::es_ES:
return Asset::get()->get("es_ES.txt");
case lang::Code::SPANISH:
return Asset::get()->get("es_ES.json");
break;
default:
return Asset::get()->get("en_UK.txt");
return Asset::get()->get("en_UK.json");
break;
}
}
@@ -104,10 +104,10 @@ namespace globalInputs
{
switch (code)
{
case lang::Code::ba_BA:
case lang::Code::VALENCIAN:
return " \"ba_BA\"";
break;
case lang::Code::es_ES:
case lang::Code::SPANISH:
return " \"es_ES\"";
break;
default:
@@ -126,12 +126,12 @@ namespace globalInputs
lang::loadFromFile(getLangFile(static_cast<lang::Code>(options.game.language)));
section::name = section::Name::INIT;
section::options = section::Options::RELOAD;
Notifier::get()->show({lang::getText(127) + getLangName(options.game.language)});
Notifier::get()->show({lang::getText("NOTIFICATIONS_127") + getLangName(options.game.language)});
}
else
{
const auto NEXT = lang::getNextLangCode(options.game.language);
Notifier::get()->show({lang::getText(126) + getLangName(NEXT), std::string()}, -1, CODE);
Notifier::get()->show({lang::getText("NOTIFICATIONS_126") + getLangName(NEXT), std::string()}, -1, CODE);
}
}
@@ -139,7 +139,7 @@ namespace globalInputs
void toggleFireMode()
{
options.game.autofire = !options.game.autofire;
Notifier::get()->show({lang::getText(130) + " " + boolToOnOff(options.game.autofire)});
Notifier::get()->show({lang::getText("MISC_130") + " " + boolToOnOff(options.game.autofire)});
}
// Salta una sección del juego
@@ -271,7 +271,7 @@ namespace globalInputs
if (Input::get()->checkInput(InputAction::WINDOW_FULLSCREEN, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
{
Screen::get()->toggleFullscreen();
const std::string MODE = options.video.fullscreen ? lang::getText(133) : lang::getText(132);
const std::string MODE = options.video.fullscreen ? lang::getText("MISC_133") : lang::getText("MISC_132");
Notifier::get()->show({MODE});
return;
}
@@ -281,7 +281,7 @@ namespace globalInputs
{
if (Screen::get()->decWindowZoom())
{
Notifier::get()->show({lang::getText(131) + " x" + std::to_string(options.window.size)});
Notifier::get()->show({lang::getText("MISC_131") + " x" + std::to_string(options.window.size)});
}
return;
}
@@ -291,7 +291,7 @@ namespace globalInputs
{
if (Screen::get()->incWindowZoom())
{
Notifier::get()->show({lang::getText(131) + " x" + std::to_string(options.window.size)});
Notifier::get()->show({lang::getText("MISC_131") + " x" + std::to_string(options.window.size)});
}
return;
}