Skip to content

Commit

Permalink
add croatian, netherlands, swedish & welsh (#21889)
Browse files Browse the repository at this point in the history
* add croatian, netherlands, swedish & welsh

* Rename Netherlands to Dutch

* Rename Netherlands to Dutch

* Change order of Dutch

* Put in place the good iso code for Welsh & Swedish
  • Loading branch information
damienleroy committed Nov 16, 2022
1 parent 78ca0d5 commit 2f36366
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
86 changes: 86 additions & 0 deletions src/modules/poweraccent/PowerAccent.Core/Languages.cs
Expand Up @@ -11,19 +11,23 @@ public enum Language
{
ALL,
CUR,
CY,
CZ,
DE,
FR,
HR,
HU,
IS,
IT,
MI,
NL,
PI,
PL,
PT,
RO,
SK,
SP,
SV,
TK,
}

Expand All @@ -35,19 +39,23 @@ public static char[] GetDefaultLetterKey(LetterKey letter, Language lang)
{
case Language.ALL: return GetDefaultLetterKeyALL(letter); // ALL
case Language.CUR: return GetDefaultLetterKeyCUR(letter); // Currency
case Language.CY: return GetDefaultLetterKeyCY(letter); // Welsh
case Language.CZ: return GetDefaultLetterKeyCZ(letter); // Czech
case Language.DE: return GetDefaultLetterKeyDE(letter); // German
case Language.FR: return GetDefaultLetterKeyFR(letter); // French
case Language.HR: return GetDefaultLetterKeyHR(letter); // Croatian
case Language.HU: return GetDefaultLetterKeyHU(letter); // Hungarian
case Language.IS: return GetDefaultLetterKeyIS(letter); // Iceland
case Language.IT: return GetDefaultLetterKeyIT(letter); // Italian
case Language.MI: return GetDefaultLetterKeyMI(letter); // Maori
case Language.NL: return GetDefaultLetterKeyNL(letter); // Dutch
case Language.PI: return GetDefaultLetterKeyPI(letter); // Pinyin
case Language.PL: return GetDefaultLetterKeyPL(letter); // Polish
case Language.PT: return GetDefaultLetterKeyPT(letter); // Portuguese
case Language.RO: return GetDefaultLetterKeyRO(letter); // Romanian
case Language.SK: return GetDefaultLetterKeySK(letter); // Slovak
case Language.SP: return GetDefaultLetterKeySP(letter); // Spain
case Language.SV: return GetDefaultLetterKeySV(letter); // Swedish
case Language.TK: return GetDefaultLetterKeyTK(letter); // Turkish
}

Expand Down Expand Up @@ -178,6 +186,24 @@ private static char[] GetDefaultLetterKeyCUR(LetterKey letter)
return Array.Empty<char>();
}

// Croatian
private static char[] GetDefaultLetterKeyHR(LetterKey letter)
{
switch (letter)
{
case LetterKey.VK_C:
return new char[] { 'ć', 'č' };
case LetterKey.VK_D:
return new char[] { 'đ' };
case LetterKey.VK_S:
return new char[] { 'š' };
case LetterKey.VK_Z:
return new char[] { 'ž' };
}

return Array.Empty<char>();
}

// French
private static char[] GetDefaultLetterKeyFR(LetterKey letter)
{
Expand Down Expand Up @@ -272,6 +298,30 @@ private static char[] GetDefaultLetterKeyMI(LetterKey letter)
return Array.Empty<char>();
}

// Dutch
private static char[] GetDefaultLetterKeyNL(LetterKey letter)
{
switch (letter)
{
case LetterKey.VK_A:
return new char[] { 'á', 'à', 'ä' };
case LetterKey.VK_C:
return new char[] { 'ç' };
case LetterKey.VK_E:
return new char[] { 'é', 'è', 'ë', 'ê', '€' };
case LetterKey.VK_I:
return new char[] { 'í', 'ï', 'î' };
case LetterKey.VK_N:
return new char[] { 'ñ' };
case LetterKey.VK_O:
return new char[] { 'ó', 'ö', 'ô' };
case LetterKey.VK_U:
return new char[] { 'ú', 'ü', 'û' };
}

return Array.Empty<char>();
}

// Pinyin
private static char[] GetDefaultLetterKeyPI(LetterKey letter)
{
Expand Down Expand Up @@ -547,5 +597,41 @@ private static char[] GetDefaultLetterKeyIT(LetterKey letter)

return Array.Empty<char>();
}

// Welsh
private static char[] GetDefaultLetterKeyCY(LetterKey letter)
{
switch (letter)
{
case LetterKey.VK_A:
return new char[] { 'â' };
case LetterKey.VK_E:
return new char[] { 'ê' };
case LetterKey.VK_I:
return new char[] { 'î' };
case LetterKey.VK_O:
return new char[] { 'ô' };
case LetterKey.VK_U:
return new char[] { 'û' };
case LetterKey.VK_Y:
return new char[] { 'ŷ' };
}

return Array.Empty<char>();
}

// Swedish
private static char[] GetDefaultLetterKeySV(LetterKey letter)
{
switch (letter)
{
case LetterKey.VK_A:
return new char[] { 'å', 'ä' };
case LetterKey.VK_O:
return new char[] { 'ö' };
}

return Array.Empty<char>();
}
}
}
12 changes: 12 additions & 0 deletions src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Expand Up @@ -2563,6 +2563,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Currency.Content" xml:space="preserve">
<value>Currency</value>
</data>
<data name="QuickAccent_SelectedLanguage_Croatian.Content" xml:space="preserve">
<value>Croatian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Czech.Content" xml:space="preserve">
<value>Czech</value>
</data>
Expand All @@ -2575,6 +2578,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Maori.Content" xml:space="preserve">
<value>Maori</value>
</data>
<data name="QuickAccent_SelectedLanguage_Dutch.Content" xml:space="preserve">
<value>Dutch</value>
</data>
<data name="QuickAccent_SelectedLanguage_Pinyin.Content" xml:space="preserve">
<value>Pinyin</value>
</data>
Expand All @@ -2590,6 +2596,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Spanish.Content" xml:space="preserve">
<value>Spanish</value>
</data>
<data name="QuickAccent_SelectedLanguage_Swedish.Content" xml:space="preserve">
<value>Swedish</value>
</data>
<data name="QuickAccent_SelectedLanguage_Turkish.Content" xml:space="preserve">
<value>Turkish</value>
</data>
Expand All @@ -2605,6 +2614,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Italian.Content" xml:space="preserve">
<value>Italian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Welsh.Content" xml:space="preserve">
<value>Welsh</value>
</data>
<data name="Hosts.ModuleDescription" xml:space="preserve">
<value>Quick and simple utility for managing hosts file.</value>
<comment>"Hosts" refers to the system hosts file, do not loc</comment>
Expand Down
Expand Up @@ -25,7 +25,9 @@ public class PowerAccentViewModel : Observable
{
"ALL",
"CUR",
"HR",
"CZ",
"NL",
"FR",
"DE",
"HU",
Expand All @@ -38,7 +40,9 @@ public class PowerAccentViewModel : Observable
"RO",
"SK",
"SP",
"SV",
"TK",
"CY",
};

private readonly string[] _toolbarOptions =
Expand Down
4 changes: 4 additions & 0 deletions src/settings-ui/Settings.UI/Views/PowerAccentPage.xaml
Expand Up @@ -53,7 +53,9 @@
<!-- 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_Currency"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Croatian"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Czech"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Dutch"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_French"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_German"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Hungarian"/>
Expand All @@ -66,7 +68,9 @@
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Romanian"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Slovakian"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Spanish"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Swedish"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Turkish"/>
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Welsh"/>
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>
Expand Down

0 comments on commit 2f36366

Please sign in to comment.