Skip to content

Commit

Permalink
[QuickAccent]Added support for Norwegian letters (#23487)
Browse files Browse the repository at this point in the history
* [QuickAccent]Added support for Norwegian letters

* Add language to Settings
  • Loading branch information
adrian-aaen authored Jan 30, 2023
1 parent 92f61d6 commit fb2b150
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/modules/poweraccent/PowerAccent.Core/Languages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum Language
MK,
MI,
NL,
NO,
PI,
PL,
PT,
Expand Down Expand Up @@ -65,6 +66,7 @@ public static string[] GetDefaultLetterKey(LetterKey letter, Language lang)
Language.MK => GetDefaultLetterKeyMK(letter), // Macedonian
Language.MI => GetDefaultLetterKeyMI(letter), // Maori
Language.NL => GetDefaultLetterKeyNL(letter), // Dutch
Language.NO => GetDefaultLetterKeyNO(letter), // Norwegian
Language.PI => GetDefaultLetterKeyPI(letter), // Pinyin
Language.PL => GetDefaultLetterKeyPL(letter), // Polish
Language.PT => GetDefaultLetterKeyPT(letter), // Portuguese
Expand Down Expand Up @@ -583,5 +585,18 @@ private static string[] GetDefaultLetterKeyMK(LetterKey letter)
_ => Array.Empty<string>(),
};
}

// Norwegian
private static string[] GetDefaultLetterKeyNO(LetterKey letter)
{
return letter switch
{
LetterKey.VK_A => new string[] { "å", "æ" },
LetterKey.VK_E => new string[] { "€" },
LetterKey.VK_O => new string[] { "ø" },
LetterKey.VK_S => new string[] { "$" },
_ => Array.Empty<string>(),
};
}
}
}
3 changes: 3 additions & 0 deletions src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2752,6 +2752,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="QuickAccent_SelectedLanguage_Dutch.Content" xml:space="preserve">
<value>Dutch</value>
</data>
<data name="QuickAccent_SelectedLanguage_Norwegian.Content" xml:space="preserve">
<value>Norwegian</value>
</data>
<data name="QuickAccent_SelectedLanguage_Pinyin.Content" xml:space="preserve">
<value>Pinyin</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class PowerAccentViewModel : Observable
"KU",
"MK",
"MI",
"NO",
"PI",
"PL",
"PT",
Expand Down
1 change: 1 addition & 0 deletions src/settings-ui/Settings.UI/Views/PowerAccentPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Kurdish" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Macedonian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Maori" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Norwegian" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Pinyin" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Polish" />
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Portuguese" />
Expand Down

0 comments on commit fb2b150

Please sign in to comment.