afegit fixer de locales (textos centralitzats)

This commit is contained in:
2026-04-05 01:24:24 +02:00
parent 5ac570df0f
commit 788a883c71
9 changed files with 226 additions and 51 deletions

View File

@@ -4,6 +4,7 @@
#include <string>
#include "core/jail/jinput.hpp"
#include "core/locale/locale.hpp"
#include "core/rendering/overlay.hpp"
#include "core/rendering/screen.hpp"
#include "game/options.hpp"
@@ -29,7 +30,7 @@ namespace GlobalInputs {
if (dec_zoom && !dec_zoom_prev) {
Screen::get()->decZoom();
char msg[32];
snprintf(msg, sizeof(msg), "ZOOM %dx", Screen::get()->getZoom());
snprintf(msg, sizeof(msg), Locale::get("notifications.zoom_fmt"), Screen::get()->getZoom());
Overlay::showNotification(msg);
}
if (dec_zoom) consumed = true;
@@ -40,7 +41,7 @@ namespace GlobalInputs {
if (inc_zoom && !inc_zoom_prev) {
Screen::get()->incZoom();
char msg[32];
snprintf(msg, sizeof(msg), "ZOOM %dx", Screen::get()->getZoom());
snprintf(msg, sizeof(msg), Locale::get("notifications.zoom_fmt"), Screen::get()->getZoom());
Overlay::showNotification(msg);
}
if (inc_zoom) consumed = true;
@@ -50,7 +51,7 @@ namespace GlobalInputs {
bool fullscreen = JI_KeyPressed(Options::keys_gui.fullscreen);
if (fullscreen && !fullscreen_prev) {
Screen::get()->toggleFullscreen();
Overlay::showNotification(Screen::get()->isFullscreen() ? "PANTALLA COMPLETA" : "FINESTRA");
Overlay::showNotification(Screen::get()->isFullscreen() ? Locale::get("notifications.fullscreen") : Locale::get("notifications.windowed"));
}
if (fullscreen) consumed = true;
fullscreen_prev = fullscreen;
@@ -59,7 +60,7 @@ namespace GlobalInputs {
bool shader = JI_KeyPressed(Options::keys_gui.toggle_shader);
if (shader && !shader_prev) {
Screen::get()->toggleShaders();
Overlay::showNotification(Options::video.shader_enabled ? "SHADER ON" : "SHADER OFF");
Overlay::showNotification(Options::video.shader_enabled ? Locale::get("notifications.shader_on") : Locale::get("notifications.shader_off"));
}
if (shader) consumed = true;
shader_prev = shader;
@@ -68,7 +69,7 @@ namespace GlobalInputs {
bool aspect = JI_KeyPressed(Options::keys_gui.toggle_aspect_ratio);
if (aspect && !aspect_prev) {
Screen::get()->toggleAspectRatio();
Overlay::showNotification(Options::video.aspect_ratio_4_3 ? "4:3 CRT" : "PIXELS QUADRATS");
Overlay::showNotification(Options::video.aspect_ratio_4_3 ? Locale::get("notifications.aspect_43") : Locale::get("notifications.aspect_square"));
}
if (aspect) consumed = true;
aspect_prev = aspect;
@@ -77,7 +78,7 @@ namespace GlobalInputs {
bool ss = JI_KeyPressed(Options::keys_gui.toggle_supersampling);
if (ss && !ss_prev) {
Screen::get()->toggleSupersampling();
Overlay::showNotification(Options::video.supersampling ? "SUPERSAMPLING ON" : "SUPERSAMPLING OFF");
Overlay::showNotification(Options::video.supersampling ? Locale::get("notifications.ss_on") : Locale::get("notifications.ss_off"));
}
if (ss) consumed = true;
ss_prev = ss;
@@ -98,7 +99,7 @@ namespace GlobalInputs {
if (next_preset && !next_preset_prev) {
Screen::get()->nextPreset();
char msg[64];
snprintf(msg, sizeof(msg), "PRESET: %s", Screen::get()->getCurrentPresetName());
snprintf(msg, sizeof(msg), Locale::get("notifications.preset_fmt"), Screen::get()->getCurrentPresetName());
Overlay::showNotification(msg);
}
if (next_preset) consumed = true;
@@ -108,7 +109,7 @@ namespace GlobalInputs {
bool stretch_filter = JI_KeyPressed(Options::keys_gui.toggle_stretch_filter);
if (stretch_filter && !stretch_filter_prev) {
Screen::get()->toggleStretchFilter();
Overlay::showNotification(Options::video.stretch_filter_linear ? "FILTRE: LINEAR" : "FILTRE: NEAREST");
Overlay::showNotification(Options::video.stretch_filter_linear ? Locale::get("notifications.filter_linear") : Locale::get("notifications.filter_nearest"));
}
if (stretch_filter) consumed = true;
stretch_filter_prev = stretch_filter;