Locale amb català (defecte) i anglès; Options.locale persistit a config.yaml (v0.10.0)
This commit is contained in:
1 parent
1b430500f4
commit
837eb73398
11 files changed
+119
-3
No files matched your search
@@ -258,6 +258,7 @@ namespace Options {
|
||||
if (file_version != Texts::VERSION) { return saveToFile(); }
|
||||
config_version = file_version;
|
||||
|
||||
if (yaml.contains("locale")) { Options::locale = yaml["locale"].get_value<std::string>(); }
|
||||
parseWindow(yaml);
|
||||
parseVideo(yaml);
|
||||
parseAudio(yaml);
|
||||
@@ -276,7 +277,8 @@ namespace Options {
|
||||
|
||||
std::ostringstream out;
|
||||
out << "# Configuració d'AEE 2026. Generat automàticament; editable a mà.\n";
|
||||
out << "version: \"" << config_version << "\"\n\n";
|
||||
out << "version: \"" << config_version << "\"\n";
|
||||
out << "locale: \"" << locale << "\"\n\n";
|
||||
|
||||
out << "window:\n";
|
||||
out << " zoom: " << window.zoom << "\n";
|
||||
|
||||
@@ -94,6 +94,7 @@ namespace Options {
|
||||
inline std::string config_file_path{};
|
||||
inline std::string postfx_file_path{};
|
||||
inline std::string crtpi_file_path{};
|
||||
inline std::string locale{Defaults::I18n::LOCALE};
|
||||
inline Window window{};
|
||||
inline Video video{};
|
||||
inline Audio audio{};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include "core/locale/locale.hpp"
|
||||
#include "core/rendering/notifier.hpp"
|
||||
#include "core/rendering/render_info.hpp"
|
||||
#include "core/rendering/screen.hpp"
|
||||
@@ -36,7 +37,7 @@ void GameScene::update(int delta_ms) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN) {
|
||||
if (event.key.scancode == SDL_SCANCODE_ESCAPE) { wants_quit_ = true; }
|
||||
if (event.key.scancode == SDL_SCANCODE_F3) { RenderInfo::get().toggle(); }
|
||||
if (event.key.scancode == SDL_SCANCODE_F4) { Notifier::get().notify("notificacio de prova"); }
|
||||
if (event.key.scancode == SDL_SCANCODE_F4) { Notifier::get().notify(Locale::get().text("notification.test")); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user