[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

@@ -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)
{