From 0099a9087c95a403bb904692dbfb6ba8eecdbd61 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:21:17 -0600 Subject: [PATCH 1/3] Fix --- src/cata_imgui.cpp | 4 ++-- src/lang_stats.inc | 1 + src/options.cpp | 6 +++--- src/system_locale.cpp | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cata_imgui.cpp b/src/cata_imgui.cpp index ae7b31986a385..89bc9c4c38be9 100644 --- a/src/cata_imgui.cpp +++ b/src/cata_imgui.cpp @@ -330,9 +330,9 @@ static void AddGlyphRangesFromCLDR( ImFontGlyphRangesBuilder *b, const std::stri AddGlyphRangesFromCLDRForNL( b ); } else if( lang == "pl" ) { AddGlyphRangesFromCLDRForPL( b ); - } else if( lang == "pt_BR" ) { + } else if( lang == "pt" ) { AddGlyphRangesFromCLDRForPT( b ); - } else if( lang == "pt_PT" ) { + } else if( lang == "pt_BR" ) { AddGlyphRangesFromCLDRForPT( b ); } else if( lang == "ru" ) { AddGlyphRangesFromCLDRForRU( b ); diff --git a/src/lang_stats.inc b/src/lang_stats.inc index 0fb36d961cfae..35ee9470689c7 100644 --- a/src/lang_stats.inc +++ b/src/lang_stats.inc @@ -19,6 +19,7 @@ {"pl"sv, 64266, 53249}, {"pt"sv, 131, 117384}, {"pt_BR"sv, 44591, 72924}, +{"pt_BR"sv, 445, 72924}, {"ro"sv, 519, 116996}, {"ru"sv, 108010, 9505}, {"sr"sv, 164, 117351}, diff --git a/src/options.cpp b/src/options.cpp index 7aa0961d8df04..6a6b461310cf1 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1360,8 +1360,8 @@ std::vector options_manager::get_lang_options() { "nb", R"(Norsk)" }, { "nl", R"(Nederlands)" }, { "pl", R"(Polski)" }, + { "pt", R"(Português (Portugal))" }, { "pt_BR", R"(Português (Brasil))" }, - { "pt_PT", R"(Português (Portugal))" }, { "ru", R"(Русский)" }, { "sr", R"(Српски)" }, { "tr", R"(Türkçe)" }, @@ -4244,10 +4244,10 @@ void options_manager::update_global_locale() std::locale::global( std::locale( "nl_NL.UTF-8" ) ); } else if( lang == "pl" ) { std::locale::global( std::locale( "pl_PL.UTF-8" ) ); + } else if( lang == "pt" ) { + std::locale::global( std::locale( "pt.UTF-8" ) ); } else if( lang == "pt_BR" ) { std::locale::global( std::locale( "pt_BR.UTF-8" ) ); - } else if( lang == "pt_PT" ) { - std::locale::global( std::locale( "pt_PT.UTF-8" ) ); } else if( lang == "ru" ) { std::locale::global( std::locale( "ru_RU.UTF-8" ) ); } else if( lang == "sr" ) { diff --git a/src/system_locale.cpp b/src/system_locale.cpp index de62f8482d73a..1fd8b06d20303 100644 --- a/src/system_locale.cpp +++ b/src/system_locale.cpp @@ -72,7 +72,8 @@ std::optional Language() {"nb", {{ 1044, 2068 }} }, {"nl", { 1043 } }, {"pl", { 1045 } }, - {"pt_BR", {{ 1046, 2070 }} }, + {"pt", { 2070 } }, + {"pt_BR", { 1046 } }, {"ru", {{ 25, 1049, 2073 }} }, {"sr", { 3098 } }, {"tr", { 1055 } }, From bb05609610acafb6ce2957b652fb3ab0ec14473e Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:42:09 -0600 Subject: [PATCH 2/3] Update src/lang_stats.inc --- src/lang_stats.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lang_stats.inc b/src/lang_stats.inc index 35ee9470689c7..0fb36d961cfae 100644 --- a/src/lang_stats.inc +++ b/src/lang_stats.inc @@ -19,7 +19,6 @@ {"pl"sv, 64266, 53249}, {"pt"sv, 131, 117384}, {"pt_BR"sv, 44591, 72924}, -{"pt_BR"sv, 445, 72924}, {"ro"sv, 519, 116996}, {"ru"sv, 108010, 9505}, {"sr"sv, 164, 117351}, From a57636ca7a88f585bce8e34b5bba8843c241cc05 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:04:55 -0600 Subject: [PATCH 3/3] Update src/options.cpp --- src/options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.cpp b/src/options.cpp index 6a6b461310cf1..55876c300a7ba 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -4245,7 +4245,7 @@ void options_manager::update_global_locale() } else if( lang == "pl" ) { std::locale::global( std::locale( "pl_PL.UTF-8" ) ); } else if( lang == "pt" ) { - std::locale::global( std::locale( "pt.UTF-8" ) ); + std::locale::global( std::locale( "pt_PT.UTF-8" ) ); } else if( lang == "pt_BR" ) { std::locale::global( std::locale( "pt_BR.UTF-8" ) ); } else if( lang == "ru" ) {