Skip to content

Commit

Permalink
[QuickAccent]Add support for Lithuanian (#23793)
Browse files Browse the repository at this point in the history
  • Loading branch information
saulens22 committed Feb 13, 2023
1 parent f34ff70 commit 8bcabe1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/modules/poweraccent/PowerAccent.Core/Languages.cs
Expand Up @@ -26,6 +26,7 @@ public enum Language
IS,
IT,
KU,
LT,
MK,
MI,
NL,
Expand Down Expand Up @@ -63,6 +64,7 @@ public static string[] GetDefaultLetterKey(LetterKey letter, Language lang)
Language.IS => GetDefaultLetterKeyIS(letter), // Iceland
Language.IT => GetDefaultLetterKeyIT(letter), // Italian
Language.KU => GetDefaultLetterKeyKU(letter), // Kurdish
Language.LT => GetDefaultLetterKeyLT(letter), // Lithuanian
Language.MK => GetDefaultLetterKeyMK(letter), // Macedonian
Language.MI => GetDefaultLetterKeyMI(letter), // Maori
Language.NL => GetDefaultLetterKeyNL(letter), // Dutch
Expand Down Expand Up @@ -598,5 +600,21 @@ private static string[] GetDefaultLetterKeyNO(LetterKey letter)
_ => Array.Empty<string>(),
};
}

// Lithuanian
private static string[] GetDefaultLetterKeyLT(LetterKey letter)
{
return letter switch
{
LetterKey.VK_A => new string[] { "ą" },
LetterKey.VK_C => new string[] { "č" },
LetterKey.VK_E => new string[] { "ę", "ė", "" },
LetterKey.VK_I => new string[] { "į" },
LetterKey.VK_S => new string[] { "š" },
LetterKey.VK_U => new string[] { "ų", "ū" },
LetterKey.VK_Z => new string[] { "ž" },
_ => Array.Empty<string>(),
};
}
}
}
3 changes: 3 additions & 0 deletions src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Expand Up @@ -2743,6 +2743,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_Lithuanian.Content" xml:space="preserve">
<value>Lithuanian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Macedonian.Content" xml:space="preserve">
<value>Macedonian</value>
</data>
Expand Down
Expand Up @@ -39,6 +39,7 @@ public class PowerAccentViewModel : Observable
"IS",
"IT",
"KU",
"LT",
"MK",
"MI",
"NO",
Expand Down
1 change: 1 addition & 0 deletions src/settings-ui/Settings.UI/Views/PowerAccentPage.xaml
Expand Up @@ -76,6 +76,7 @@
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Icelandic" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Italian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Kurdish" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Lithuanian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Macedonian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Maori" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Norwegian" />
Expand Down

0 comments on commit 8bcabe1

Please sign in to comment.