mirror of
https://github.com/microsoft/PowerToys
synced 2024-11-22 00:03:48 +00:00
[QuickAccent]Add Middle Eastern Romanization (#31905)
* [Quick Accent] Add support for Middle Eastern Romanization * Update ToUpper() (PowerAccent.cs) * Add right single quotation mark * rework ToUpper() * rework ToUpper() * Update ToUpper() * Internal strings more about Romanization
This commit is contained in:
parent
6415afc27d
commit
cc586a0357
@ -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<string>(),
|
||||
};
|
||||
}
|
||||
|
||||
// Slovak
|
||||
private static string[] GetDefaultLetterKeySK(LetterKey letter)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -83,6 +83,7 @@
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Polish" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Portuguese" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Romanian" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Romanization" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Slovak" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Slovenian" />
|
||||
<ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Spanish" />
|
||||
|
@ -3584,6 +3584,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_Romanization.Content" xml:space="preserve">
|
||||
<value>Middle Eastern Romanization</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage_Dutch.Content" xml:space="preserve">
|
||||
<value>Dutch</value>
|
||||
</data>
|
||||
|
@ -54,6 +54,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
"PL",
|
||||
"PT",
|
||||
"RO",
|
||||
"ROM",
|
||||
"SK",
|
||||
"SL",
|
||||
"SP",
|
||||
|
Loading…
Reference in New Issue
Block a user