From a44e65461f47aae44bea81c006a515834412a66d Mon Sep 17 00:00:00 2001 From: Erasmo Bellumat Date: Thu, 13 Aug 2026 19:58:36 -0300 Subject: [PATCH] Implementation: Add Portuguese to MORE_LANGUAGES (#36) Brazilian Portuguese has one of the larger GTA communities and a long-standing fan translation, but no way to select it: the language menu stops at Spanish and Text.cpp has no filename for it, so a translated GXT can only be used by overwriting AMERICAN.GXT and losing English. This is the same shape as the Polish, Russian and Japanese entries already there - enum value, PORTUGUESE.GXT in both lookups, menu action and row. No font set is needed: Portuguese is Latin-1 and the existing EFIGS set already covers its accented characters, so the default branch in InitialiseChangedLanguageSettings handles it. No game data is added. The player supplies PORTUGUESE.GXT themselves, exactly as with every other language. FEL_POR is not a key in the stock GXT, so the entry shows its key name until a translation provides the string - the same situation as the other MORE_LANGUAGES entries, and it is selectable either way. --- src/core/Frontend.cpp | 8 ++++++++ src/core/Frontend.h | 4 ++++ src/core/MenuScreens.cpp | 3 +++ src/text/Text.cpp | 6 ++++++ 4 files changed, 21 insertions(+) diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index f2e26e50..35b74631 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -4759,6 +4759,14 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u InitialiseChangedLanguageSettings(); SaveSettings(); break; +#ifdef MORE_LANGUAGES + case MENUACTION_LANG_POR: + m_PrefsLanguage = LANGUAGE_PORTUGUESE; + m_bFrontEnd_ReloadObrTxtGxt = true; + InitialiseChangedLanguageSettings(); + SaveSettings(); + break; +#endif case MENUACTION_CHECKSAVE: { int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot; diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 1afd62c7..38f92efa 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -267,6 +267,9 @@ enum eMenuAction MENUACTION_LANG_GER, MENUACTION_LANG_ITA, MENUACTION_LANG_SPA, +#ifdef MORE_LANGUAGES + MENUACTION_LANG_POR, +#endif MENUACTION_POPULATESLOTS_CHANGEMENU, MENUACTION_CHECKSAVE, MENUACTION_NEWGAME, @@ -748,6 +751,7 @@ public: LANGUAGE_POLISH, LANGUAGE_RUSSIAN, LANGUAGE_JAPANESE, + LANGUAGE_PORTUGUESE, #endif }; bool GetIsMenuActive() {return !!m_bMenuActive;} diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp index 295038d9..f6dccad3 100644 --- a/src/core/MenuScreens.cpp +++ b/src/core/MenuScreens.cpp @@ -80,6 +80,9 @@ CMenuScreen aScreens[] = { MENUACTION_LANG_GER, "FEL_GER", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS, 0, 0, MENUALIGN_CENTER, MENUACTION_LANG_ITA, "FEL_ITA", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS, 0, 0, MENUALIGN_CENTER, MENUACTION_LANG_SPA, "FEL_SPA", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS, 0, 0, MENUALIGN_CENTER, +#ifdef MORE_LANGUAGES + MENUACTION_LANG_POR, "FEL_POR", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS, 0, 0, MENUALIGN_CENTER, +#endif MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, MENUALIGN_CENTER, }, diff --git a/src/text/Text.cpp b/src/text/Text.cpp index 0e703966..50bc9b72 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -71,6 +71,9 @@ CText::Load(void) case CMenuManager::LANGUAGE_JAPANESE: sprintf(filename, "JAPANESE.GXT"); break; + case CMenuManager::LANGUAGE_PORTUGUESE: + sprintf(filename, "PORTUGUESE.GXT"); + break; #endif } @@ -275,6 +278,9 @@ CText::LoadMissionText(char *MissionTableName) case CMenuManager::LANGUAGE_JAPANESE: sprintf(filename, "JAPANESE.GXT"); break; + case CMenuManager::LANGUAGE_PORTUGUESE: + sprintf(filename, "PORTUGUESE.GXT"); + break; #endif } CTimer::Suspend();