Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Accent: Add currencies to VK_3 and VK_4 (most commonly used keys for currencies) #36665

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions src/modules/poweraccent/PowerAccent.Core/Languages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,30 +257,40 @@ private static string[] GetDefaultLetterKeyCRH(LetterKey letter)
}

// Currencies (source: https://www.eurochange.co.uk/travel-money/world-currency-abbreviations-symbols-and-codes-travel-money)
private static string[] GetDefaultLetterKeyCUR(LetterKey letter)
{
return letter switch
{
LetterKey.VK_B => new[] { "฿", "в" },
LetterKey.VK_C => new[] { "¢", "₡", "č" },
LetterKey.VK_D => new[] { "₫" },
LetterKey.VK_E => new[] { "€" },
LetterKey.VK_F => new[] { "ƒ" },
LetterKey.VK_H => new[] { "₴" },
LetterKey.VK_K => new[] { "₭" },
LetterKey.VK_L => new[] { "ł" },
LetterKey.VK_N => new[] { "л" },
LetterKey.VK_M => new[] { "₼" },
LetterKey.VK_P => new[] { "£", "₽" },
LetterKey.VK_R => new[] { "₹", "៛", "﷼" },
LetterKey.VK_S => new[] { "$", "₪" },
LetterKey.VK_T => new[] { "₮", "₺", "₸" },
LetterKey.VK_W => new[] { "₩" },
LetterKey.VK_Y => new[] { "¥" },
LetterKey.VK_Z => new[] { "z" },
_ => Array.Empty<string>(),
};
}
private static string[] GetDefaultLetterKeyCUR(LetterKey letter) => letter switch
{
LetterKey.VK_B => new[] { "฿", "в", "₿" },
LetterKey.VK_C => new[] { "¢", "₡", "č" },
LetterKey.VK_D => new[] { "₫" },
LetterKey.VK_E => new[] { "€", "£" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion: the origin of the symbol - that is the letter L - outweighs a disputable visual resemblance. If it were we, I would not add it here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does anyone know that's the origin symbol? I live in England and I would not have guessed that. This suggestion feels like sacrificing usability for semantics. Also, with this change, it's in both, which was the suggested fix in the later posts in the issue, so both views are addressed.

LetterKey.VK_F => new[] { "ƒ" },
LetterKey.VK_H => new[] { "₴" },
LetterKey.VK_K => new[] { "₭" },
LetterKey.VK_L => new[] { "ł", "£" },
LetterKey.VK_M => new[] { "₼" },
LetterKey.VK_N => new[] { "л" },
LetterKey.VK_O => new[] { "¤" },
LetterKey.VK_P => new[] { "£", "₽" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Just like there's no dollar sign under the "D".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pound sign is and was under P so this comment contradicts the existing code base.

LetterKey.VK_R => new[] { "₹", "៛", "﷼" },
LetterKey.VK_S => new[] { "$", "₪" },
LetterKey.VK_T => new[] { "₮", "₺", "₸" },
LetterKey.VK_W => new[] { "₩" },
LetterKey.VK_Y => new[] { "¥" },
LetterKey.VK_Z => new[] { "z" },
LetterKey.VK_3 => new[]
{
"฿", "в", "₿", "¢", "₡", "č", "₫", "€", "£", "ƒ",
"₴", "₭", "ł", "₼", "л", "¤", "₽", "₹", "៛", "﷼",
"$","₪", "₮", "₺", "₸", "₩", "¥", "z",
}, // VK_3 is commonly used for the locale currency symbol
LetterKey.VK_4 => new[]
{
"฿", "в", "₿", "¢", "₡", "č", "₫", "€", "£", "ƒ",
"₴", "₭", "ł", "₼", "л", "¤", "₽", "₹", "៛", "﷼",
"$","₪", "₮", "₺", "₸", "₩", "¥", "z",
}, // VK_4 is commonly used for the locale currency symbol
_ => Array.Empty<string>(),
};

// Croatian
private static string[] GetDefaultLetterKeyHR(LetterKey letter)
Expand Down
Loading