Repository: microsoft/terminal (language: cpp)

Issue:
Localization gone since 1.13.10336.0
### Windows Terminal version

1.13.10336.0

### Windows build number

22000.469

### Other Software

_No response_

### Steps to reproduce

Install Windows Terminal Preview 1.13.10336.0.

### Expected Behavior

Previously available localizations remain.

### Actual Behavior

The entire UI has lost its localization and switched to English. I can also see under Settings -> Appearance -> Language that English is the only option available apart from the "system default" option. My system locale is de-DE.


Discussion / hints:
Holy s**t.
This is bad.
Fwiw, I have the same issue with [Windows Terminal v1.12.10334.0](https://github.com/microsoft/terminal/releases/tag/v1.12.10334.0) downloaded from the github release page.

Fix patch:
diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt
index 2f0a8a588e9..c34f03a2018 100644
--- a/.github/actions/spelling/expect/expect.txt
+++ b/.github/actions/spelling/expect/expect.txt
@@ -471,6 +471,7 @@ cygwin
 CYHSCROLL
 CYMIN
 CYPADDEDBORDER
+CYRL
 CYSIZE
 CYSIZEFRAME
 CYSMICON
@@ -1238,12 +1239,14 @@ KLF
 KLMNO
 KLMNOPQRST
 KLMNOPQRSTQQQQQ
+KOK
 KPRIORITY
 KVM
 langid
 LANGUAGELIST
 lasterror
 lastexitcode
+LATN
 LAYOUTRTL
 LBN
 LBound
@@ -1792,6 +1795,9 @@ placeholders
 platforming
 playsound
 plist
+PLOC
+PLOCA
+PLOCM
 PLOGICAL
 plugin
 PMv
@@ -1925,6 +1931,7 @@ qsort
 queryable
 QUESTIONMARK
 quickedit
+QUZ
 QWER
 qzmp
 RAII
diff --git a/src/cascadia/CascadiaPackage/Package-Dev.appxmanifest b/src/cascadia/CascadiaPackage/Package-Dev.appxmanifest
index 715068f32b6..9658fd1804c 100644
--- a/src/cascadia/CascadiaPackage/Package-Dev.appxmanifest
+++ b/src/cascadia/CascadiaPackage/Package-Dev.appxmanifest
@@ -30,7 +30,7 @@
   </Dependencies>
 
   <Resources>
-    <Resource Language="x-generate"/>
+    <Resource Language="EN-US" />
   </Resources>
 
   <Applications>
diff --git a/src/cascadia/CascadiaPackage/Package-Pre.appxmanifest b/src/cascadia/CascadiaPackage/Package-Pre.appxmanifest
index ea949350e84..9b9ef83ae32 100644
--- a/src/cascadia/CascadiaPackage/Package-Pre.appxmanifest
+++ b/src/cascadia/CascadiaPackage/Package-Pre.appxmanifest
@@ -31,7 +31,95 @@
   </Dependencies>
 
   <Resources>
-    <Resource Language="x-generate"/>
+    <Resource Language="EN-US" />
+    <Resource Language="EN-GB" />
+    <Resource Language="AF-ZA" />
+    <Resource Language="AM-ET" />
+    <Resource Language="AR-SA" />
+    <Resource Language="AS-IN" />
+    <Resource Language="AZ-LATN-AZ" />
+    <Resource Language="BG-BG" />
+    <Resource Language="BN-IN" />
+    <Resource Language="BS-LATN-BA" />
+    <Resource Language="CA-ES" />
+    <Resource Language="CA-ES-VALENCIA" />
+    <Resource Language="CS-CZ" />
+    <Resource Language="CY-GB" />
+    <Resource Language="DA-DK" />
+    <Resource Language="DE-DE" />
+    <Resource Language="EL-GR" />
+    <Resource Language="ES-ES" />
+    <Resource Language="ES-MX" />
+    <Resource Language="ET-EE" />
+    <Resource Language="EU-ES" />
+    <Resource Language="FA-IR" />
+    <Resource Language="FI-FI" />
+    <Resource Language="FIL-PH" />
+    <Resource Language="FR-CA" />
+    <Resource Language="FR-FR" />
+    <Resource Language="GA-IE" />
+    <Resource Language="GD-GB" />
+    <Resource Language="GL-ES" />
+    <Resource Language="GU-IN" />
+    <Resource Language="HE-IL" />
+    <Resource Language="HI-IN" />
+    <Resource Language="HR-HR" />
+    <Resource Language="HU-HU" />
+    <Resource Language="HY-AM" />
+    <Resource Language="ID-ID" />
+    <Resource Language="IS-IS" />
+    <Resource Language="IT-IT" />
+    <Resource Language="JA-JP" />
+    <Resource Language="KA-GE" />
+    <Resource Language="KK-KZ" />
+    <Resource Language="KM-KH" />
+    <Resource Language="KN-IN" />
+    <Resource Language="KO-KR" />
+    <Resource Language="KOK-IN" />
+    <Resource Language="LB-LU" />
+    <Resource Language="LO-LA" />
+    <Resource Language="LT-LT" />
+    <Resource Language="LV-LV" />
+    <Resource Language="MI-NZ" />
+    <Resource Language="MK-MK" />
+    <Resource Language="ML-IN" />
+    <Resource Language="MR-IN" />
+    <Resource Language="MS-MY" />
+    <Resource Language="MT-MT" />
+    <Resource Language="NB-NO" />
+    <Resource Language="NE-NP" />
+    <Resource Language="NL-NL" />
+    <Resource Language="NN-NO" />
+    <Resource Language="OR-IN" />
+    <Resource Language="PA-IN" />
+    <Resource Language="PL-PL" />
+    <Resource Language="PT-BR" />
+    <Resource Language="PT-PT" />
+    <Resource Language="QPS-PLOC" />
+    <Resource Language="QPS-PLOCA" />
+    <Resource Language="QPS-PLOCM" />
+    <Resource Language="QUZ-PE" />
+    <Resource Language="RO-RO" />
+    <Resource Language="RU-RU" />
+    <Resource Language="SK-SK" />
+    <Resource Language="SL-SI" />
+    <Resource Language="SQ-AL" />
+    <Resource Language="SR-CYRL-BA" />
+    <Resource Language="SR-CYRL-RS" />
+    <Resource Language="SR-LATN-RS" />
+    <Resource Language="SV-SE" />
+    <Resource Language="TA-IN" />
+    <Resource Language="TE-IN" />
+    <Resource Language="TH-TH" />
+    <Resource Language="TR-TR" />
+    <Resource Language="TT-RU" />
+    <Resource Language="UG-CN" />
+    <Resource Language="UK-UA" />
+    <Resource Language="UR-PK" />
+    <Resource Language="UZ-LATN-UZ" />
+    <Resource Language="VI-VN" />
+    <Resource Language="ZH-CN" />
+    <Resource Language="ZH-TW" />
   </Resources>
 
   <Applications>
diff --git a/src/cascadia/CascadiaPackage/Package.appxmanifest b/src/cascadia/CascadiaPackage/Package.appxmanifest
index c02e8b940d8..900454ef99e 100644
--- a/src/cascadia/CascadiaPackage/Package.appxmanifest
+++ b/src/cascadia/CascadiaPackage/Package.appxmanifest
@@ -31,7 +31,95 @@
   </Dependencies>
 
   <Resources>
-    <Resource Language="x-generate"/>
+    <Resource Language="EN-US" />
+    <Resource Language="EN-GB" />
+    <Resource Language="AF-ZA" />
+    <Resource Language="AM-ET" />
+    <Resource Language="AR-SA" />
+    <Resource Language="AS-IN" />
+    <Resource Language="AZ-LATN-AZ" />
+    <Resource Language="BG-BG" />
+    <Resource Language="BN-IN" />
+    <Resource Language="BS-LATN-BA" />
+    <Resource Language="CA-ES" />
+    <Resource Language="CA-ES-VALENCIA" />
+    <Resource Language="CS-CZ" />
+    <Resource Language="CY-GB" />
+    <Resource Language="DA-DK" />
+    <Resource Language="DE-DE" />
+    <Resource Language="EL-GR" />
+    <Resource Language="ES-ES" />
+    <Resource Language="ES-MX" />
+    <Resource Language="ET-EE" />
+    <Resource Language="EU-ES" />
+    <Resource Language="FA-IR" />
+    <Resource Language="FI-FI" />
+    <Resource Language="FIL-PH" />
+    <Resource Language="FR-CA" />
+    <Resource Language="FR-FR" />
+    <Resource Language="GA-IE" />
+    <Resource Language="GD-GB" />
+    <Resource Language="GL-ES" />
+    <Resource Language="GU-IN" />
+    <Resource Language="HE-IL" />
+    <Resource Language="HI-IN" />
+    <Resource Language="HR-HR" />
+    <Resource Language="HU-HU" />
+    <Resource Language="HY-AM" />
+    <Resource Language="ID-ID" />
+    <Resource Language="IS-IS" />
+    <Resource Language="IT-IT" />
+    <Resource Language="JA-JP" />
+    <Resource Language="KA-GE" />
+    <Resource Language="KK-KZ" />
+    <Resource Language="KM-KH" />
+    <Resource Language="KN-IN" />
+    <Resource Language="KO-KR" />
+    <Resource Language="KOK-IN" />
+    <Resource Language="LB-LU" />
+    <Resource Language="LO-LA" />
+    <Resource Language="LT-LT" />
+    <Resource Language="LV-LV" />
+    <Resource Language="MI-NZ" />
+    <Resource Language="MK-MK" />
+    <Resource Language="ML-IN" />
+    <Resource Language="MR-IN" />
+    <Resource Language="MS-MY" />
+    <Resource Language="MT-MT" />
+    <Resource Language="NB-NO" />
+    <Resource Language="NE-NP" />
+    <Resource Language="NL-NL" />
+    <Resource Language="NN-NO" />
+    <Resource Language="OR-IN" />
+    <Resource Language="PA-IN" />
+    <Resource Language="PL-PL" />
+    <Resource Language="PT-BR" />
+    <Resource Language="PT-PT" />
+    <Resource Language="QPS-PLOC" />
+    <Resource Language="QPS-PLOCA" />
+    <Resource Language="QPS-PLOCM" />
+    <Resource Language="QUZ-PE" />
+    <Resource Language="RO-RO" />
+    <Resource Language="RU-RU" />
+    <Resource Language="SK-SK" />
+    <Resource Language="SL-SI" />
+    <Resource Language="SQ-AL" />
+    <Resource Language="SR-CYRL-BA" />
+    <Resource Language="SR-CYRL-RS" />
+    <Resource Language="SR-LATN-RS" />
+    <Resource Language="SV-SE" />
+    <Resource Language="TA-IN" />
+    <Resource Language="TE-IN" />
+    <Resource Language="TH-TH" />
+    <Resource Language="TR-TR" />
+    <Resource Language="TT-RU" />
+    <Resource Language="UG-CN" />
+    <Resource Language="UK-UA" />
+    <Resource Language="UR-PK" />
+    <Resource Language="UZ-LATN-UZ" />
+    <Resource Language="VI-VN" />
+    <Resource Language="ZH-CN" />
+    <Resource Language="ZH-TW" />
   </Resources>
 
   <Applications>
diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
index 399f00440a8..fd9aa78d4f4 100644
--- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
+++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
@@ -24,6 +24,23 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
     // --> "und" is synonymous for "Use system language".
     constexpr std::wstring_view systemLanguageTag{ L"und" };
 
+    static constexpr std::array appLanguageTags{
+        L"en-US",
+        L"de-DE",
+        L"es-ES",
+        L"fr-FR",
+        L"it-IT",
+        L"ja",
+        L"ko",
+        L"pt-BR",
+        L"qps-PLOC",
+        L"qps-PLOCA",
+        L"qps-PLOCM",
+        L"ru",
+        L"zh-Hans-CN",
+        L"zh-Hant-TW",
+    };
+
     GlobalAppearance::GlobalAppearance()
     {
         InitializeComponent();
@@ -88,43 +105,22 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         // [1]:
         {
             // ManifestLanguages contains languages the app ships with.
-            //
-            // Languages is a computed list that merges the ManifestLanguages with the
-            // user's ranked list of preferred languages taken from the system settings.
-            // As is tradition the API documentation is incomplete though, as it can also
-            // contain regional language variants. If our app supports en-US, but the user
-            // has en-GB or en-DE in their system's preferred language list, Languages will
-            // contain those as well, as they're variants from a supported language. We should
-            // allow a user to select those, as regional formattings can vary significantly.
-            const std::array tagSources{
-                winrt::Windows::Globalization::ApplicationLanguages::ManifestLanguages(),
-                winrt::Windows::Globalization::ApplicationLanguages::Languages()
-            };
-
-            // tags will hold all the flattened results from tagSources.
-            // We resize() the vector to the proper size in order to efficiently GetMany() all items.
-            tags.resize(std::accumulate(
-                tagSources.begin(),
-                tagSources.end(),
-                // tags[0] will be "und" - the "Use system language" item
-                // tags[1..n] will contain tags from tagSources.
-                // --> totalTags is offset by 1
-                1,
-                [](uint32_t sum, const auto& v) -> uint32_t {
-                    return sum + v.Size();
-                }));
+            // Unfortunately, we cannot use this source. Our manifest must contain the
+            // ~100 languages that are localized for the shell extension and start menu
+            // presentation so we align with Windows display languages for those surfaces.
+            // However, the actual content of our application is limited to a much smaller
+            // subset of approximately 14 languages. As such, we will code the limited
+            // subset of languages that we support for selection within the Settings
+            // dropdown to steer users towards the ones that we can display in the app.
 
             // As per the function definition, the first item
             // is always "Use system language" ("und").
-            auto data = tags.data();
-            *data++ = systemLanguageTag;
+            tags.emplace_back(systemLanguageTag);
 
-            // Finally GetMany() all the tags from tagSources.
-            for (const auto& v : tagSources)
+            // Add our hardcoded languages after the system definition.
+            for (const auto& v : appLanguageTags)
             {
-                const auto size = v.Size();
-                v.GetMany(0, winrt::array_view(data, size));
-                data += size;
+                tags.push_back(v);
             }
         }
 


Test patch: