From 49b1446d8f19e4de8b14ae48fb8e066ccf1736a2 Mon Sep 17 00:00:00 2001 From: GabsPuNs Date: Mon, 18 May 2026 17:58:39 -0400 Subject: [PATCH] Better Language Support, move custom strings to stringsProjectZenith.xml --- .../Common/UI/UIScene_JoinMenu.cpp | 4 +- .../Common/UI/UIScene_Keyboard.cpp | 14 ++-- .../Common/UI/UIScene_LoadCreateJoinMenu.cpp | 10 +-- Minecraft.Client/Common/UI/UIStructs.h | 2 +- .../loc/es-ES/stringsGeneric.xml | 78 ++++--------------- .../loc/es-ES/stringsProjectZenith.xml | 61 +++++++++++++++ .../loc/ru-RU/stringsLanguages.xml | 40 ++++++++++ .../loc/ru-RU/stringsProjectZenith.xml | 78 +++++++++++++++++++ .../Windows64Media/loc/stringsGeneric.xml | 64 --------------- .../loc/stringsProjectZenith.xml | 76 ++++++++++++++++++ 10 files changed, 287 insertions(+), 140 deletions(-) create mode 100644 Minecraft.Client/Windows64Media/loc/es-ES/stringsProjectZenith.xml create mode 100644 Minecraft.Client/Windows64Media/loc/ru-RU/stringsLanguages.xml create mode 100644 Minecraft.Client/Windows64Media/loc/ru-RU/stringsProjectZenith.xml create mode 100644 Minecraft.Client/Windows64Media/loc/stringsProjectZenith.xml diff --git a/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp index dd469856..f0b5ce54 100644 --- a/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp @@ -126,9 +126,9 @@ void UIScene_JoinMenu::tick() if (m_serverIndex >= 0) { m_editServerButtonIndex = m_buttonListPlayers.getItemCount(); - m_buttonListPlayers.addItem(L"Edit Server"); + m_buttonListPlayers.addItem(app.GetString(IDS_SERVER_EDIT)); m_deleteServerButtonIndex = m_buttonListPlayers.getItemCount(); - m_buttonListPlayers.addItem(L"Delete Server"); + m_buttonListPlayers.addItem(app.GetString(IDS_SERVER_DELETE)); } #endif diff --git a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp index 35edf17f..d90653fc 100644 --- a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp @@ -6,7 +6,7 @@ #ifdef _WINDOWS64 // Global buffer that stores the text entered in the native keyboard scene. // Callbacks retrieve it via Win64_GetKeyboardText() declared in UIStructs.h. -wchar_t g_Win64KeyboardResult[256] = {}; +wchar_t g_Win64KeyboardResult[128] = {}; #endif #define KEYBOARD_DONE_TIMER_ID 0 @@ -32,8 +32,12 @@ UIScene_Keyboard::UIScene_Keyboard(int iPad, void *initData, UILayer *parentLaye UIKeyboardInitData* kbData = static_cast(initData); m_win64Callback = kbData->callback; m_win64CallbackParam = kbData->lpParam; - if (kbData->title) titleText = kbData->title; - if (kbData->defaultText) defaultText = kbData->defaultText; + + if (kbData->title) + titleText = kbData->title; + if (kbData->defaultText) + defaultText = kbData->defaultText; + m_win64MaxChars = kbData->maxChars; m_bPCMode = kbData->pcMode; } @@ -59,7 +63,7 @@ UIScene_Keyboard::UIScene_Keyboard(int iPad, void *initData, UILayer *parentLaye m_ButtonCursorLeft.init(L"Cur L", -1); m_ButtonCursorRight.init(L"Cur R", -1); m_ButtonCaps.init(L"Caps", -1); - m_ButtonDone.init(L"Done", 0); // only the done button needs an id, the others will never call back! + m_ButtonDone.init(IDS_DONE, 0); // only the done button needs an id, the others will never call back! m_ButtonSymbols.init(L"Symbols", -1); m_ButtonBackspace.init(L"Backspace", -1); @@ -414,7 +418,7 @@ void UIScene_Keyboard::KeyboardDonePressed() app.DebugPrintf("UI Keyboard - DONE - [%ls]\n", finalText); // Store the typed text so callbacks can retrieve it via Win64_GetKeyboardText() - wcsncpy_s(g_Win64KeyboardResult, 256, finalText, _TRUNCATE); + wcsncpy_s(g_Win64KeyboardResult, 128, finalText, _TRUNCATE); // Cache callback and param before navigateBack() which destroys this scene int(*cb)(LPVOID, const bool) = m_win64Callback; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp index 0edfc459..028fe6ed 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp @@ -2429,7 +2429,7 @@ void UIScene_LoadCreateJoinMenu::RebuildJoinGamesListVisual(bool syncFocus) #ifdef _WINDOWS64 // Always add the "Add Server" button as the first entry in the games list - m_buttonListGames.addItem(wstring(L"Add Server")); + m_buttonListGames.addItem(app.GetString(IDS_SERVER_ADD)); TrySetButtonListIcon( m_buttonListGames, m_buttonListGames.getItemCount() - 1, @@ -5914,7 +5914,7 @@ void UIScene_LoadCreateJoinMenu::BeginAddServer() UIKeyboardInitData kbData; - kbData.title = L"Server Address"; + kbData.title = app.GetString(IDS_SERVER_ADDRESS); kbData.defaultText = L""; kbData.maxChars = 128; kbData.callback = &UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback; @@ -6059,7 +6059,7 @@ int UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback(LPVOID lpParam, bool b UIKeyboardInitData kbData; - kbData.title = L"Server Port"; + kbData.title = app.GetString(IDS_SERVER_PORT); kbData.defaultText = L"25565"; kbData.maxChars = 6; kbData.callback = &UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback; @@ -6079,8 +6079,8 @@ int UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback(LPVOID lpParam, bool b UIKeyboardInitData kbData; - kbData.title = L"Server Name"; - kbData.defaultText = L"Minecraft Server"; + kbData.title = app.GetString(IDS_SERVER_NAME); + kbData.defaultText = app.GetString(IDS_SERVER_MINECRAFT); kbData.maxChars = 64; kbData.callback = &UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback; kbData.lpParam = pClass; diff --git a/Minecraft.Client/Common/UI/UIStructs.h b/Minecraft.Client/Common/UI/UIStructs.h index f88fcb0a..aad77d3f 100644 --- a/Minecraft.Client/Common/UI/UIStructs.h +++ b/Minecraft.Client/Common/UI/UIStructs.h @@ -301,7 +301,7 @@ typedef struct _UIKeyboardInitData // Stores the text typed in UIScene_Keyboard so callbacks can retrieve it // without calling InputManager.GetText (which shows the WinAPI dialog result). -extern wchar_t g_Win64KeyboardResult[256]; +extern wchar_t g_Win64KeyboardResult[128]; inline void Win64_GetKeyboardText(uint16_t* outBuf, int maxChars) { wcsncpy_s((wchar_t*)outBuf, maxChars, g_Win64KeyboardResult, _TRUNCATE); diff --git a/Minecraft.Client/Windows64Media/loc/es-ES/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/es-ES/stringsGeneric.xml index a00eeafb..183d5f57 100644 --- a/Minecraft.Client/Windows64Media/loc/es-ES/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/es-ES/stringsGeneric.xml @@ -470,27 +470,36 @@ No + + Modo juego: Supervivencia + Modo juego: Creativo + + Modo juego: Aventura + Supervivencia Creativo + + Aventura + + + En modo Supervivencia + + + En modo Creativo + Cambiar nombre del mundo Escribe un nuevo nombre para tu mundo. - - Modo juego: Supervivencia - - - En modo Supervivencia - Cambiar nombre a juego guardado @@ -500,9 +509,6 @@ - - En modo Creativo - Generar nubes @@ -1745,12 +1751,6 @@ Si decides unirte a este juego, se eliminará el nivel de la lista de niveles bl Cuando se desactiva, las criaturas no se generarán de forma natural. - - Modo juego: Aventura - - - Aventura - Introduce una semilla para volver a generar el mismo terreno. Déjalo vacío para generar un mundo aleatorio. @@ -6866,52 +6866,4 @@ Todos los cofres de Ender de un mundo están vinculados, y los objetos que conti Salir de Minecraft - - FOV - - - Distancia de renderizado - - - Animación de golpe clásica - - - Patata - - - Rápido - - - Detallado - - - ¡Fabuloso! - - - Sonidos de cueva - - - Creación clásica - - - Generales - - - Gráficas - - - Opciones Generales - - - Opciones Gráficas - - - Cargar - - - Crear - - - Unirse - \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/es-ES/stringsProjectZenith.xml b/Minecraft.Client/Windows64Media/loc/es-ES/stringsProjectZenith.xml new file mode 100644 index 00000000..21ede263 --- /dev/null +++ b/Minecraft.Client/Windows64Media/loc/es-ES/stringsProjectZenith.xml @@ -0,0 +1,61 @@ + + + + FOV + + + Distancia de renderizado + + + Animación de golpe clásica + + + + Patata + + + Rápido + + + Detallado + + + ¡Fabuloso! + + + + Generales + + + Gráficas + + + + Opciones generales + + + Opciones gráficas + + + + Añadir servidor + + + Dirección del servidor + + + Puerto del servidor + + + Nombre del servidor + + + Servidor de Minecraft + + + Editar servidor + + + Eliminar servidor + + \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/ru-RU/stringsLanguages.xml b/Minecraft.Client/Windows64Media/loc/ru-RU/stringsLanguages.xml new file mode 100644 index 00000000..1468a170 --- /dev/null +++ b/Minecraft.Client/Windows64Media/loc/ru-RU/stringsLanguages.xml @@ -0,0 +1,40 @@ + + + System Language + English + + German + + Spanish + Spanish (Spain) + Spanish (Latin America) + + French + + Italian + + Portuguese + Portuguese (Portugal) + Portuguese (Brazil) + + Japanese + + Korean + + Chinese (Traditional) + Chinese (Simplified) + + Danish + Finnish + + Dutch + + Polish + Russian + Swedish + Norwegian + + Greek + + Turkish + \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/ru-RU/stringsProjectZenith.xml b/Minecraft.Client/Windows64Media/loc/ru-RU/stringsProjectZenith.xml new file mode 100644 index 00000000..902b68ff --- /dev/null +++ b/Minecraft.Client/Windows64Media/loc/ru-RU/stringsProjectZenith.xml @@ -0,0 +1,78 @@ + + + FOV + + + Render Distance + + + Classic Swing Animation + + + Cave Sounds + + + Classic Crafting + + + + Potato + + + Fast + + + Fancy + + + Fabulous! + + + + Load + + + + Create + + + + Join + + + + General + + + Quality + + + + General Options + + + Quality Options + + + + Add Server + + + Server Address + + + Server Port + + + Server Name + + + Minecraft Server + + + Edit Server + + + Delete Server + + \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index 1454a5f2..e4f40d09 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -8919,68 +8919,4 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Exit Minecraft - - - FOV - - - - Render Distance - - - - Classic Swing Animation - - - - Potato - - - - Fast - - - - Fancy - - - - Fabulous! - - - - Cave Sounds - - - - Classic Crafting - - - - General - - - - Quality - - - - General Options - - - - Quality Options - - - - Load - - - - Create - - - - Join - \ No newline at end of file diff --git a/Minecraft.Client/Windows64Media/loc/stringsProjectZenith.xml b/Minecraft.Client/Windows64Media/loc/stringsProjectZenith.xml new file mode 100644 index 00000000..5565f91c --- /dev/null +++ b/Minecraft.Client/Windows64Media/loc/stringsProjectZenith.xml @@ -0,0 +1,76 @@ + + + FOV + + + Render Distance + + + Classic Swing Animation + + + Sonidos de cueva + + + Creación clásica + + + + Potato + + + Fast + + + Fancy + + + Fabulous! + + + + Cargar + + + Crear + + + Unirse + + + + General + + + Quality + + + + General Options + + + Quality Options + + + + Add Server + + + Server Address + + + Server Port + + + Server Name + + + Minecraft Server + + + Edit Server + + + Delete Server + + \ No newline at end of file