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

Fix uppercase behaviour with telex #2267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hayleia
Copy link
Contributor

@Hayleia Hayleia commented Jul 14, 2023

Basically in the current master code, when typing for example Anhs, 'A' is uppercase and this decides that the whole result of the rule will be uppercased (ÁNH), which is most likely not what the user intended. We only want the first character to be uppercased, so we can replace "value.uppercase()" with "value.replaceFirstChar(Char::titlecase)".
However, this fix would also mean that typing ANHS gives Ánh as a result, which is also most likely not what the user intended.

So the proper fix is a better case detection and management, such as

  • If every character was uppercase, then uppercase the whole result (ANHS→ÁNH).
  • Else if only the first character was uppercase, then only uppercase the first character in the result (Anhs→Ánh).
  • Else if everything was lowercase, keep everything lowercase (anhs→ánh).
  • Else, well this is a weird case and I guess anything is acceptable for such a rare case? (aNhs→ánh for example).

Closes #2260.

@Hayleia Hayleia force-pushed the telexUppercase branch 2 times, most recently from 77b11b1 to 5c51b67 Compare July 14, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Vietnamese Telex] Uppercase error in Vietnamese Telex
1 participant