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 @@ - + 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 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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); } }