feat(locale): sistema i18n YAML amb català i anglès
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "core/audio/audio.hpp"
|
||||
#include "core/input/input.hpp"
|
||||
#include "core/locale/locale.hpp"
|
||||
#include "core/system/scene_context.hpp"
|
||||
#include "game/stage_system/stage_loader.hpp"
|
||||
#include "game/systems/collision_system.hpp"
|
||||
@@ -608,7 +609,7 @@ void GameScene::drawGameOverState() {
|
||||
firework_manager_.draw();
|
||||
floating_score_manager_.draw();
|
||||
|
||||
const std::string GAME_OVER_TEXT = "GAME OVER";
|
||||
const std::string GAME_OVER_TEXT = Locale::get().text("game_screen.game_over");
|
||||
constexpr float SCALE = Defaults::Game::GameOverScreen::TEXT_SCALE;
|
||||
constexpr float SPACING = Defaults::Game::GameOverScreen::TEXT_SPACING;
|
||||
|
||||
@@ -710,7 +711,7 @@ void GameScene::drawLevelCompletedState() {
|
||||
debris_manager_.draw();
|
||||
firework_manager_.draw();
|
||||
floating_score_manager_.draw();
|
||||
drawStageMessage(StageSystem::Constants::MISSATGE_LEVEL_COMPLETED);
|
||||
drawStageMessage(Locale::get().text("stage.completed"));
|
||||
drawScoreboard();
|
||||
}
|
||||
|
||||
@@ -814,7 +815,7 @@ auto GameScene::buildScoreboard() const -> std::string {
|
||||
|
||||
// Format: "123456 03 LEVEL 01 654321 02"
|
||||
// Nota: dos espais entre seccions, mantenir ambdós slots siempre visibles
|
||||
return score_p1 + " " + vides_p1 + " LEVEL " + stage_str + " " + score_p2 + " " + vides_p2;
|
||||
return score_p1 + " " + vides_p1 + " " + Locale::get().text("hud.level") + stage_str + " " + score_p2 + " " + vides_p2;
|
||||
}
|
||||
|
||||
// [NEW] Stage system helper methods
|
||||
@@ -946,7 +947,7 @@ void GameScene::drawContinue() {
|
||||
constexpr float SPACING = 4.0F;
|
||||
|
||||
// "CONTINUE" text (using constants)
|
||||
const std::string CONTINUE_TEXT = "CONTINUE";
|
||||
const std::string CONTINUE_TEXT = Locale::get().text("game_screen.continue");
|
||||
float escala_continue = Defaults::Game::ContinueScreen::CONTINUE_TEXT_SCALE;
|
||||
float y_ratio_continue = Defaults::Game::ContinueScreen::CONTINUE_TEXT_Y_RATIO;
|
||||
|
||||
@@ -966,7 +967,10 @@ void GameScene::drawContinue() {
|
||||
|
||||
// "CONTINUES LEFT" (conditional + using constants)
|
||||
if (!Defaults::Game::INFINITE_CONTINUES) {
|
||||
const std::string CONTINUES_TEXT = "CONTINUES LEFT: " + std::to_string(Defaults::Game::MAX_CONTINUES - continues_used_);
|
||||
const std::string CONTINUES_TEXT = localeSubstitute(
|
||||
Locale::get().text("game_screen.continues_left"),
|
||||
"{n}",
|
||||
std::to_string(Defaults::Game::MAX_CONTINUES - continues_used_));
|
||||
float escala_info = Defaults::Game::ContinueScreen::INFO_TEXT_SCALE;
|
||||
float y_ratio_info = Defaults::Game::ContinueScreen::INFO_TEXT_Y_RATIO;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "core/defaults.hpp"
|
||||
#include "core/graphics/shape_loader.hpp"
|
||||
#include "core/input/input.hpp"
|
||||
#include "core/locale/locale.hpp"
|
||||
#include "core/math/easing.hpp"
|
||||
#include "core/rendering/shape_renderer.hpp"
|
||||
#include "core/system/scene_context.hpp"
|
||||
@@ -602,7 +603,7 @@ void TitleScene::draw() {
|
||||
mostrar_text = (std::sin(FASE) > 0.0F);
|
||||
}
|
||||
if (mostrar_text) {
|
||||
const std::string MAIN_TEXT = "PRESS START TO PLAY";
|
||||
const std::string MAIN_TEXT = Locale::get().text("title.press_start");
|
||||
const float MAIN_SCALE = Defaults::Title::Layout::PRESS_START_SCALE;
|
||||
const float CENTRE_X = Defaults::Game::WIDTH / 2.0F;
|
||||
const float CENTRE_Y = Defaults::Game::HEIGHT * Defaults::Title::Layout::PRESS_START_POS;
|
||||
|
||||
Reference in New Issue
Block a user