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

[Suggestion]: Treat French special characters like Monkeytype does #22

Closed
idoric opened this issue Jun 9, 2024 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@idoric
Copy link

idoric commented Jun 9, 2024

Context

The most common French keyboard layout (AZERTY) doesn't allow to type certain French characters. The French rely heavily on the autocorrection systems of word processors to compensate for this lack (for example "oe" is automatically replaced by "œ"). But we don't always write in a word processor, and some French people use keyboard layouts better designed for French (in particular Bépo and Ergo-L).
And these users want to practice typing these characters, and get the right reflexes (for example in good French typography the exclamation point is preceded by a narrow no-break space U+202F). To satisfy everyone, Monkeytype offers a solution that is not very clean but sufficient in practice, and which has the advantage of being easily implementable.

Monkeytype's solution

In the texts to be typed in French there are no special characters (for example the word "cœur" is written "coeur", as a child would write), and then certain characters typed by users are automatically replaced:

  • œ is replaced by oe
  • æ is replaced by ae
  • … (one character) is replaced by ... (three characters)
  • NNBSP (U+202F) and NBSP (U+00A0) are replaced by SPACE (U+0020)
  • ’ is replaced by '
  • ‑ (non-breaking hyphen), – (En Dash) and — (Em Dash) are replaced by - (Hyphen-Minus)
  • (and probably others)
@idoric idoric added the enhancement New feature or request label Jun 9, 2024
@bragefuglseth
Copy link
Owner

Hi, and thanks for the suggestion! This makes sense to me, but there are multiple things to take into consideration if we're going to do it:

  • The replacements don't make sense in all languages. For instance, the Nordic keyboard layout has the letter Æ as a proper key, and replacing it with "ae" would look alien to Norwegians and Danes. So we'd have to special case both the replacement and input logic for when French is chosen as the text language.
  • Special casing adds code complexity, especially for the input machinery.

I think we can come to a solution, but it needs some thinking through first.

@bragefuglseth
Copy link
Owner

I think we can do this better than Monkeytype, and display those letters as-is while allowing them to be typed as one would in a word processor. It requires #24, though.

@idoric
Copy link
Author

idoric commented Jun 11, 2024

That would be really great!

@bragefuglseth
Copy link
Owner

This should be completed by #24.

The current aliases are:

œ - oe
æ - ae
« - "
» - "
non-breaking whitespaces - regular space

If one is able to enter the original letters directly, that is of course still possible.

Let me know if there are any more that are relevant for French. I'll make sure to update the alias list if I come up with any relevant characters myself.

@idoric
Copy link
Author

idoric commented Jun 21, 2024

Here are the ones I thought about:

Π- OE
Æ - AE
… - ...
’⁽¹⁾ - '
There are no strict rules regarding the use of the non-breaking hyphen, so I would think that the easiest way to satisfy everyone would be for the hyphen (- U+002D) and the non-breaking hyphen (‑ U+2011) to both be an alias of the other.

⁽¹⁾ In France it is called the typographic apostrophe (apostrophe typographique)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants