From a80896d51bf6f94e66d13f3bb5a616f53d37d54c Mon Sep 17 00:00:00 2001 From: PesBandi <127593627+PesBandi@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:14:43 +0200 Subject: [PATCH] [QuickAccent] Add International Phonetic Alphabet characters (#33104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add IPA, everything done except ʡ ʔ ʕ ʢ * VK_COMMA * Add comment --- .../poweraccent/PowerAccent.Core/Languages.cs | 31 +++++++++++++++++++ .../SettingsXAML/Views/PowerAccentPage.xaml | 1 + .../Settings.UI/Strings/en-us/Resources.resw | 4 +++ .../ViewModels/PowerAccentViewModel.cs | 1 + 4 files changed, 37 insertions(+) diff --git a/src/modules/poweraccent/PowerAccent.Core/Languages.cs b/src/modules/poweraccent/PowerAccent.Core/Languages.cs index f6ba1b07e6..bf799fb7ea 100644 --- a/src/modules/poweraccent/PowerAccent.Core/Languages.cs +++ b/src/modules/poweraccent/PowerAccent.Core/Languages.cs @@ -28,6 +28,7 @@ namespace PowerAccent.Core HE, HU, IS, + IPA, IT, KU, LT, @@ -72,6 +73,7 @@ namespace PowerAccent.Core Language.HE => GetDefaultLetterKeyHE(letter), // Hebrew Language.HU => GetDefaultLetterKeyHU(letter), // Hungarian Language.IS => GetDefaultLetterKeyIS(letter), // Iceland + Language.IPA => GetDefaultLetterKeyIPA(letter), // IPA (International phonetic alphabet) Language.IT => GetDefaultLetterKeyIT(letter), // Italian Language.KU => GetDefaultLetterKeyKU(letter), // Kurdish Language.LT => GetDefaultLetterKeyLT(letter), // Lithuanian @@ -119,6 +121,7 @@ namespace PowerAccent.Core .Union(GetDefaultLetterKeyHE(letter)) .Union(GetDefaultLetterKeyHU(letter)) .Union(GetDefaultLetterKeyIS(letter)) + .Union(GetDefaultLetterKeyIPA(letter)) .Union(GetDefaultLetterKeyIT(letter)) .Union(GetDefaultLetterKeyKU(letter)) .Union(GetDefaultLetterKeyLT(letter)) @@ -792,5 +795,33 @@ namespace PowerAccent.Core _ => Array.Empty(), }; } + + // IPA (International Phonetic Alphabet) + private static string[] GetDefaultLetterKeyIPA(LetterKey letter) + { + return letter switch + { + LetterKey.VK_A => new[] { "ɐ", "ɑ", "ɒ" }, + LetterKey.VK_B => new[] { "ʙ" }, + LetterKey.VK_E => new[] { "ɘ", "ɵ", "ə", "ɛ", "ɜ", "ɞ" }, + LetterKey.VK_F => new[] { "ɟ", "ɸ" }, + LetterKey.VK_G => new[] { "ɢ", "ɣ" }, + LetterKey.VK_H => new[] { "ɦ", "ʜ" }, + LetterKey.VK_I => new[] { "ɨ", "ɪ" }, + LetterKey.VK_J => new[] { "ʝ" }, + LetterKey.VK_L => new[] { "ɬ", "ɮ", "ꞎ", "ɭ", "ʎ", "ʟ", "ɺ" }, + LetterKey.VK_N => new[] { "ɳ", "ɲ", "ŋ", "ɴ" }, + LetterKey.VK_O => new[] { "ɤ", "ɔ", "ɶ" }, + LetterKey.VK_R => new[] { "ʁ", "ɹ", "ɻ", "ɾ", "ɽ", "ʀ" }, + LetterKey.VK_S => new[] { "ʃ", "ʂ", "ɕ" }, + LetterKey.VK_U => new[] { "ʉ", "ʊ" }, + LetterKey.VK_V => new[] { "ʋ", "ⱱ", "ʌ" }, + LetterKey.VK_W => new[] { "ɰ", "ɯ" }, + LetterKey.VK_Y => new[] { "ʏ" }, + LetterKey.VK_Z => new[] { "ʒ", "ʐ", "ʑ" }, + LetterKey.VK_COMMA => new[] { "ʡ", "ʔ", "ʕ", "ʢ" }, + _ => Array.Empty(), + }; + } } } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml index 2c7092f323..b57ffc8792 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml @@ -71,6 +71,7 @@ + diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 41b869d343..5099a48b41 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -3491,6 +3491,10 @@ Activate by holding the key for the character you want to add an accent to, then Esperanto + + IPA + International Phonetic Alphabet + Lithuanian diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs index d3dc5f655c..6c4d1a7951 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs @@ -42,6 +42,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels "HE", "HU", "IS", + "IPA", "IT", "KU", "LT",