[QuickAccent]Add support for Esperanto (#32605)

* Add support for Esperanto for PowerAccent

* Add missing UI part

* Add `EPO` to the exception list

* Remove multiple blank lines

* Add Strings

---------

Co-authored-by: ccmywish <ccmywish@qq.com>
This commit is contained in:
Calascibetta Nomen
2024-05-08 04:55:13 +08:00
committed by GitHub
parent 3fe78fed65
commit 77d3071fb3
5 changed files with 24 additions and 0 deletions

View File

@@ -421,6 +421,7 @@ ENTERSIZEMOVE
ENU
EOAC
epu
EPO
ERASEBKGND
EREOF
EResize

View File

@@ -20,6 +20,7 @@ namespace PowerAccent.Core
DE,
EL,
EST,
EPO,
FI,
FR,
HR,
@@ -62,6 +63,7 @@ namespace PowerAccent.Core
Language.DE => GetDefaultLetterKeyDE(letter), // German
Language.EL => GetDefaultLetterKeyEL(letter), // Greek
Language.EST => GetDefaultLetterKeyEST(letter), // Estonian
Language.EPO => GetDefaultLetterKeyEPO(letter), // Esperanto
Language.FI => GetDefaultLetterKeyFI(letter), // Finnish
Language.FR => GetDefaultLetterKeyFR(letter), // French
Language.HR => GetDefaultLetterKeyHR(letter), // Croatian
@@ -107,6 +109,7 @@ namespace PowerAccent.Core
.Union(GetDefaultLetterKeyDE(letter))
.Union(GetDefaultLetterKeyEL(letter))
.Union(GetDefaultLetterKeyEST(letter))
.Union(GetDefaultLetterKeyEPO(letter))
.Union(GetDefaultLetterKeyFI(letter))
.Union(GetDefaultLetterKeyFR(letter))
.Union(GetDefaultLetterKeyHR(letter))
@@ -244,6 +247,21 @@ namespace PowerAccent.Core
};
}
// Esperanto
private static string[] GetDefaultLetterKeyEPO(LetterKey letter)
{
return letter switch
{
LetterKey.VK_C => new[] { "ĉ" },
LetterKey.VK_G => new[] { "ĝ" },
LetterKey.VK_H => new[] { "ĥ" },
LetterKey.VK_J => new[] { "ĵ" },
LetterKey.VK_S => new[] { "ŝ" },
LetterKey.VK_U => new[] { "ǔ" },
_ => Array.Empty<string>(),
};
}
// Finnish
private static string[] GetDefaultLetterKeyFI(LetterKey letter)
{

View File

@@ -63,6 +63,7 @@
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Dutch" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Greek" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Estonian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Esperanto" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Finnish" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_French" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_German" />

View File

@@ -3436,6 +3436,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Estonian.Content" xml:space="preserve">
<value>Estonian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Esperanto.Content" xml:space="preserve">
<value>Esperanto</value>
</data>
<data name="QuickAccent_SelectedLanguage_Lithuanian.Content" xml:space="preserve">
<value>Lithuanian</value>
</data>

View File

@@ -34,6 +34,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
"NL",
"EL",
"EST",
"EPO",
"FI",
"FR",
"DE",