diff --git a/src/modules/poweraccent/PowerAccent.Core/Languages.cs b/src/modules/poweraccent/PowerAccent.Core/Languages.cs index a689bf078d..d79800dbad 100644 --- a/src/modules/poweraccent/PowerAccent.Core/Languages.cs +++ b/src/modules/poweraccent/PowerAccent.Core/Languages.cs @@ -42,6 +42,7 @@ namespace PowerAccent.Core PL, PT, RO, + ROM, SK, SL, SP, @@ -88,6 +89,7 @@ namespace PowerAccent.Core Language.PL => GetDefaultLetterKeyPL(letter), // Polish Language.PT => GetDefaultLetterKeyPT(letter), // Portuguese Language.RO => GetDefaultLetterKeyRO(letter), // Romanian + Language.ROM => GetDefaultLetterKeyROM(letter), // Middle Eastern Romanization Language.SK => GetDefaultLetterKeySK(letter), // Slovak Language.SL => GetDefaultLetterKeySL(letter), // Slovenian Language.SP => GetDefaultLetterKeySP(letter), // Spain @@ -129,6 +131,7 @@ namespace PowerAccent.Core .Union(GetDefaultLetterKeyIT(letter)) .Union(GetDefaultLetterKeyKU(letter)) .Union(GetDefaultLetterKeyLT(letter)) + .Union(GetDefaultLetterKeyROM(letter)) .Union(GetDefaultLetterKeyMK(letter)) .Union(GetDefaultLetterKeyMI(letter)) .Union(GetDefaultLetterKeyNL(letter)) @@ -494,6 +497,37 @@ namespace PowerAccent.Core }; } + // Middle Eastern Romanization + private static string[] GetDefaultLetterKeyROM(LetterKey letter) + { + return letter switch + { + LetterKey.VK_A => new[] { "á", "â", "ă", "ā" }, + LetterKey.VK_B => new[] { "ḇ" }, + LetterKey.VK_C => new[] { "č", "ç" }, + LetterKey.VK_D => new[] { "ḑ", "ḍ", "ḏ", "ḏ\u0323" }, + LetterKey.VK_E => new[] { "ê", "ě", "ĕ", "ē", "é", "ə" }, + LetterKey.VK_G => new[] { "ġ", "ǧ", "ğ", "ḡ", "g\u0303", "g\u0331" }, + LetterKey.VK_H => new[] { "ḧ", "ḩ", "ḥ", "ḫ", "h\u0331" }, + LetterKey.VK_I => new[] { "í", "ı", "î", "ī", "ı\u0307\u0304" }, + LetterKey.VK_J => new[] { "ǰ", "j\u0331" }, + LetterKey.VK_K => new[] { "ḳ", "ḵ" }, + LetterKey.VK_L => new[] { "ł" }, + LetterKey.VK_N => new[] { "ⁿ", "ñ" }, + LetterKey.VK_O => new[] { "ó", "ô", "ö", "ŏ", "ō", "ȫ" }, + LetterKey.VK_P => new[] { "p\u0304" }, + LetterKey.VK_R => new[] { "ṙ", "ṛ" }, + LetterKey.VK_S => new[] { "ś", "š", "ş", "ṣ", "s\u0331", "ṣ\u0304" }, + LetterKey.VK_T => new[] { "ẗ", "ţ", "ṭ", "ṯ" }, + LetterKey.VK_U => new[] { "ú", "û", "ü", "ū", "ǖ" }, + LetterKey.VK_V => new[] { "v\u0307", "ṿ", "ᵛ" }, + LetterKey.VK_Y => new[] { "̀y" }, + LetterKey.VK_Z => new[] { "ż", "ž", "z\u0304", "z\u0327", "ẓ", "z\u0324", "ẕ" }, + LetterKey.VK_PERIOD => new[] { "’", "ʾ", "ʿ", "′", "…" }, + _ => Array.Empty(), + }; + } + // Slovak private static string[] GetDefaultLetterKeySK(LetterKey letter) { diff --git a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs index a9638fa0fc..a1802ba428 100644 --- a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs +++ b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs @@ -348,7 +348,15 @@ public class PowerAccent : IDisposable string[] result = new string[array.Length]; for (int i = 0; i < array.Length; i++) { - result[i] = array[i].Contains('ß') ? "ẞ" : array[i].ToUpper(System.Globalization.CultureInfo.InvariantCulture); + switch (array[i]) + { + case "ß": result[i] = "ẞ"; break; + case "ǰ": result[i] = "J\u030c"; break; + case "ı\u0307\u0304": result[i] = "İ\u0304"; break; + case "ı": result[i] = "İ"; break; + case "ᵛ": result[i] = "ⱽ"; break; + default: result[i] = array[i].ToUpper(System.Globalization.CultureInfo.InvariantCulture); break; + } } return result; diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml index 1a28b8c83e..0c75c60c92 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml @@ -83,6 +83,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 1a0817304d..a409727295 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -3584,6 +3584,9 @@ Activate by holding the key for the character you want to add an accent to, then Maori + + Middle Eastern Romanization + Dutch diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs index a69ba0b976..99ef36afb9 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs @@ -54,6 +54,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels "PL", "PT", "RO", + "ROM", "SK", "SL", "SP",