writemonkey / wm3

165 stars 5 forks source link

Writemonkey for french #342

Open h-u-g-u-e-s opened 4 years ago

h-u-g-u-e-s commented 4 years ago

Hello, I use Writemonkey to write mostly in French. Is it possible to add custom autocorrect strings to taylor the application for this language?

E.g.:

writemonkey commented 4 years ago

Hi, you can use Autoreplace plugin (https://github.com/writemonkey/wm3/wiki/Documentation#auto-replace) for those. Note that replacements are made after space is pressed. Also, quotes will cause problem because of smart characters (https://github.com/writemonkey/wm3/wiki/Documentation#smart-characters). Those can be reconfigured, though. i.

h-u-g-u-e-s commented 4 years ago

Thank you. I used Autoreplace and disabled Smart Characters.

  1. Is it possible to enter a non-breaking space in Autoreplace's package.json?   does not work.
  2. Is it possible to replace similar items with some code? E.g.: ' plus A E I O U output À È Ì Ò Ù (instead of writing each in a single line:)
    {"t": "'A", "À": "", "moveCursor": 0, "keepSpace": false},
    {"t": "'E", "È": "", "moveCursor": 0, "keepSpace": false},
    etc.

    I'll be happy to post my workaround for other french users.

h-u-g-u-e-s commented 4 years ago

So, I've prepend:

{ "t": "'E", "r": "É", "moveCursor": 0, "keepSpace": false },
{ "t": "`A", "r": "À", "moveCursor": 0, "keepSpace": false },
{ "t": "`E", "r": "È", "moveCursor": 0, "keepSpace": false },
{ "t": "`U", "r": "Ù", "moveCursor": 0, "keepSpace": false },
{ "t": ",C", "r": "Ç", "moveCursor": 0, "keepSpace": false },
{ "t": "OE", "r": "Œ", "moveCursor": 0, "keepSpace": false },
{ "t": "oe", "r": "œ", "moveCursor": 0, "keepSpace": false },
{ "t": "AE", "r": "Æ", "moveCursor": 0, "keepSpace": false },
{ "t": "ae", "r": "æ", "moveCursor": 0, "keepSpace": false },

and these should normally do for anyone with an AZERTY keyboard for diacritics and ligatures.

I am still helpless though concerning typography, and specially spaces. One way of going about it would be to leave the input screen unchanged and have only the output/preview modified: e.g. Écoutez-vous: "Für Elise"? or Écoutez-vous : "Für Elise" ? in WM would output:

But I don't know where to start. I also don't understand how to get Smartypants to work.