[Quick Accent]Add Catalan language accents (#22228)

* [QuickAccent] Add catalan

* Add missing l·l symbol

and improve order

* Fix build error

* Remove trailing white space

* [QuickAccent] put Catalan language in alphabet order (#22228)

Co-authored-by: CodingNeko <codingneko@gmail.com>
This commit is contained in:
Ivo Carbajo
2022-11-25 13:43:24 +01:00
committed by GitHub
parent b9367c0ca6
commit c057babf2b
4 changed files with 35 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ namespace PowerAccent.Core
public enum Language public enum Language
{ {
ALL, ALL,
CA,
CUR, CUR,
CY, CY,
CZ, CZ,
@@ -38,6 +39,7 @@ namespace PowerAccent.Core
switch (lang) switch (lang)
{ {
case Language.ALL: return GetDefaultLetterKeyALL(letter); // ALL case Language.ALL: return GetDefaultLetterKeyALL(letter); // ALL
case Language.CA: return GetDefaultLetterKeyCA(letter); // Catalan
case Language.CUR: return GetDefaultLetterKeyCUR(letter); // Currency case Language.CUR: return GetDefaultLetterKeyCUR(letter); // Currency
case Language.CY: return GetDefaultLetterKeyCY(letter); // Welsh case Language.CY: return GetDefaultLetterKeyCY(letter); // Welsh
case Language.CZ: return GetDefaultLetterKeyCZ(letter); // Czech case Language.CZ: return GetDefaultLetterKeyCZ(letter); // Czech
@@ -276,6 +278,34 @@ namespace PowerAccent.Core
return Array.Empty<string>(); return Array.Empty<string>();
} }
// Catalan
private static string[] GetDefaultLetterKeyCA(LetterKey letter)
{
switch (letter)
{
case LetterKey.VK_A:
return new string[] { "à", "á" };
case LetterKey.VK_C:
return new string[] { "ç" };
case LetterKey.VK_E:
return new string[] { "è", "é", "€" };
case LetterKey.VK_I:
return new string[] { "ì", "í", "ï" };
case LetterKey.VK_N:
return new string[] { "ñ" };
case LetterKey.VK_O:
return new string[] { "ò", "ó" };
case LetterKey.VK_U:
return new string[] { "ù", "ú", "ü" };
case LetterKey.VK_L:
return new string[] { "·" };
case LetterKey.VK_COMMA:
return new string[] { "¿", "?" };
}
return Array.Empty<string>();
}
// Maori // Maori
private static string[] GetDefaultLetterKeyMI(LetterKey letter) private static string[] GetDefaultLetterKeyMI(LetterKey letter)
{ {

View File

@@ -2549,6 +2549,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_Catalan.Content" xml:space="preserve">
<value>Catalan</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

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

View File

@@ -61,6 +61,7 @@
SelectedIndex="{x:Bind Path=ViewModel.SelectedLangIndex, Mode=TwoWay}"> 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_Catalan"/>
<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" />