[QuickAccent]Add Bulgarian (#33550)

## Summary of the Pull Request
Adds Bulgarian to Quick Accent

## Detailed Description of the Pull Request / Additional comments
Adds Cyrillic letter short I (й)
This commit is contained in:
octastylos-pseudodipteros 2024-07-17 16:44:42 +02:00 committed by GitHub
parent b7c8bb201b
commit f1ca65ca78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 2 deletions

View File

@ -10,6 +10,7 @@ namespace PowerAccent.Core
public enum Language
{
ALL,
BG,
CA,
CRH,
CUR,
@ -54,7 +55,8 @@ namespace PowerAccent.Core
{
return lang switch
{
Language.ALL => GetDefaultLetterKeyALL(letter), // ALL
Language.ALL => GetDefaultLetterKeyALL(letter), // All
Language.BG => GetDefaultLetterKeyBG(letter), // Bulgarian
Language.CA => GetDefaultLetterKeyCA(letter), // Catalan
Language.CRH => GetDefaultLetterKeyCRH(letter), // Crimean Tatar
Language.CUR => GetDefaultLetterKeyCUR(letter), // Currency
@ -103,7 +105,8 @@ namespace PowerAccent.Core
{
if (!_allLanguagesCache.TryGetValue(letter, out string[] cachedValue))
{
cachedValue = GetDefaultLetterKeyCA(letter)
cachedValue = GetDefaultLetterKeyBG(letter)
.Union(GetDefaultLetterKeyCA(letter))
.Union(GetDefaultLetterKeyCRH(letter))
.Union(GetDefaultLetterKeyCUR(letter))
.Union(GetDefaultLetterKeyCY(letter))
@ -198,6 +201,16 @@ namespace PowerAccent.Core
};
}
// Bulgarian
private static string[] GetDefaultLetterKeyBG(LetterKey letter)
{
return letter switch
{
LetterKey.VK_I => new[] { "й" },
_ => Array.Empty<string>(),
};
}
// Crimean Tatar
private static string[] GetDefaultLetterKeyCRH(LetterKey letter)
{

View File

@ -53,6 +53,7 @@
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.SelectedLangIndex, Mode=TwoWay}">
<!-- 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_Bulgarian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Crimean" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Currency" />

View File

@ -3444,6 +3444,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_All.Content" xml:space="preserve">
<value>All available</value>
</data>
<data name="QuickAccent_SelectedLanguage_Bulgarian.Content" xml:space="preserve">
<value>Bulgarian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Catalan.Content" xml:space="preserve">
<value>Catalan</value>
</data>

View File

@ -24,6 +24,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private readonly string[] _languageOptions =
{
"ALL",
"BG",
"CA",
"CRH",
"CUR",