[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
4 changed files with 20 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ namespace PowerAccent.Core
public enum Language public enum Language
{ {
ALL, ALL,
BG,
CA, CA,
CRH, CRH,
CUR, CUR,
@@ -54,7 +55,8 @@ namespace PowerAccent.Core
{ {
return lang switch return lang switch
{ {
Language.ALL => GetDefaultLetterKeyALL(letter), // ALL Language.ALL => GetDefaultLetterKeyALL(letter), // All
Language.BG => GetDefaultLetterKeyBG(letter), // Bulgarian
Language.CA => GetDefaultLetterKeyCA(letter), // Catalan Language.CA => GetDefaultLetterKeyCA(letter), // Catalan
Language.CRH => GetDefaultLetterKeyCRH(letter), // Crimean Tatar Language.CRH => GetDefaultLetterKeyCRH(letter), // Crimean Tatar
Language.CUR => GetDefaultLetterKeyCUR(letter), // Currency Language.CUR => GetDefaultLetterKeyCUR(letter), // Currency
@@ -103,7 +105,8 @@ namespace PowerAccent.Core
{ {
if (!_allLanguagesCache.TryGetValue(letter, out string[] cachedValue)) if (!_allLanguagesCache.TryGetValue(letter, out string[] cachedValue))
{ {
cachedValue = GetDefaultLetterKeyCA(letter) cachedValue = GetDefaultLetterKeyBG(letter)
.Union(GetDefaultLetterKeyCA(letter))
.Union(GetDefaultLetterKeyCRH(letter)) .Union(GetDefaultLetterKeyCRH(letter))
.Union(GetDefaultLetterKeyCUR(letter)) .Union(GetDefaultLetterKeyCUR(letter))
.Union(GetDefaultLetterKeyCY(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 // Crimean Tatar
private static string[] GetDefaultLetterKeyCRH(LetterKey letter) private static string[] GetDefaultLetterKeyCRH(LetterKey letter)
{ {

View File

@@ -53,6 +53,7 @@
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.SelectedLangIndex, Mode=TwoWay}"> <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 --> <!-- 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_Bulgarian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Crimean" /> <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Crimean" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Currency" /> <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"> <data name="QuickAccent_SelectedLanguage_All.Content" xml:space="preserve">
<value>All available</value> <value>All available</value>
</data> </data>
<data name="QuickAccent_SelectedLanguage_Bulgarian.Content" xml:space="preserve">
<value>Bulgarian</value>
</data>
<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>

View File

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