[QuickAccent]Add Crimean Tatar character set (#32862)

* Update Languages.cs

Add Crimean Tatar Language

* Update PowerAccentPage.xaml

Add Crimean Tatar language

* Update PowerAccentViewModel.cs

Add Crimean Tatar language

* Update Resources.resw

Add Crimean Tatar language

* Update Languages.cs

Add Crimean Tatar language

* Update expect.txt

Add "CHR" to spellcheker false positives (ISO code for Crimean Tatar language)

* Update expect.txt

Add "CRH" to spellcheker false positives (ISO code for Crimean Tatar language)

* Update Languages.cs

* Update src/modules/poweraccent/PowerAccent.Core/Languages.cs

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

---------

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
This commit is contained in:
Illia Pyshniak
2024-06-04 11:45:26 +03:00
committed by GitHub
parent 949df59c9e
commit a54dc0e52a
5 changed files with 29 additions and 0 deletions

View File

@@ -250,6 +250,7 @@ CREATESCHEDULEDTASK
CREATESTRUCT CREATESTRUCT
CREATEWINDOWFAILED CREATEWINDOWFAILED
CRECT CRECT
CRH
critsec critsec
Crossdevice Crossdevice
CRSEL CRSEL

View File

@@ -11,6 +11,7 @@ namespace PowerAccent.Core
{ {
ALL, ALL,
CA, CA,
CRH,
CUR, CUR,
CY, CY,
CZ, CZ,
@@ -54,6 +55,7 @@ namespace PowerAccent.Core
{ {
Language.ALL => GetDefaultLetterKeyALL(letter), // ALL Language.ALL => GetDefaultLetterKeyALL(letter), // ALL
Language.CA => GetDefaultLetterKeyCA(letter), // Catalan Language.CA => GetDefaultLetterKeyCA(letter), // Catalan
Language.CRH => GetDefaultLetterKeyCRH(letter), // Crimean Tatar
Language.CUR => GetDefaultLetterKeyCUR(letter), // Currency Language.CUR => GetDefaultLetterKeyCUR(letter), // Currency
Language.CY => GetDefaultLetterKeyCY(letter), // Welsh Language.CY => GetDefaultLetterKeyCY(letter), // Welsh
Language.CZ => GetDefaultLetterKeyCZ(letter), // Czech Language.CZ => GetDefaultLetterKeyCZ(letter), // Czech
@@ -100,6 +102,7 @@ namespace PowerAccent.Core
if (!_allLanguagesCache.TryGetValue(letter, out string[] cachedValue)) if (!_allLanguagesCache.TryGetValue(letter, out string[] cachedValue))
{ {
cachedValue = GetDefaultLetterKeyCA(letter) cachedValue = GetDefaultLetterKeyCA(letter)
.Union(GetDefaultLetterKeyCRH(letter))
.Union(GetDefaultLetterKeyCUR(letter)) .Union(GetDefaultLetterKeyCUR(letter))
.Union(GetDefaultLetterKeyCY(letter)) .Union(GetDefaultLetterKeyCY(letter))
.Union(GetDefaultLetterKeyCZ(letter)) .Union(GetDefaultLetterKeyCZ(letter))
@@ -192,6 +195,26 @@ namespace PowerAccent.Core
}; };
} }
// Crimean Tatar
private static string[] GetDefaultLetterKeyCRH(LetterKey letter)
{
return letter switch
{
LetterKey.VK_A => new[] { "â" },
LetterKey.VK_C => new[] { "ç" },
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_G => new[] { "ğ" },
LetterKey.VK_H => new[] { "₴" },
LetterKey.VK_I => new[] { "ı", "İ" },
LetterKey.VK_N => new[] { "ñ" },
LetterKey.VK_O => new[] { "ö" },
LetterKey.VK_S => new[] { "ş" },
LetterKey.VK_T => new[] { "₺" },
LetterKey.VK_U => new[] { "ü" },
_ => Array.Empty<string>(),
};
}
// Currencies (source: https://www.eurochange.co.uk/travel-money/world-currency-abbreviations-symbols-and-codes-travel-money) // Currencies (source: https://www.eurochange.co.uk/travel-money/world-currency-abbreviations-symbols-and-codes-travel-money)
private static string[] GetDefaultLetterKeyCUR(LetterKey letter) private static string[] GetDefaultLetterKeyCUR(LetterKey letter)
{ {

View File

@@ -54,6 +54,7 @@
<!-- These should be in the same order as the array items in PowerAccentViewModel.cs --> <!-- These should be in the same order as the array items in PowerAccentViewModel.cs -->
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_All" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_All" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Crimean" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Currency" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Currency" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Croatian" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Croatian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Czech" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Czech" />

View File

@@ -3447,6 +3447,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Catalan.Content" xml:space="preserve"> <data name="QuickAccent_SelectedLanguage_Catalan.Content" xml:space="preserve">
<value>Catalan</value> <value>Catalan</value>
</data> </data>
<data name="QuickAccent_SelectedLanguage_Crimean.Content" xml:space="preserve">
<value>Crimean Tatar</value>
</data>
<data name="QuickAccent_SelectedLanguage_Currency.Content" xml:space="preserve"> <data name="QuickAccent_SelectedLanguage_Currency.Content" xml:space="preserve">
<value>Currency</value> <value>Currency</value>
</data> </data>

View File

@@ -25,6 +25,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{ {
"ALL", "ALL",
"CA", "CA",
"CRH",
"CUR", "CUR",
"HR", "HR",
"CZ", "CZ",