A minimal browser extension for removing the typo warnings related to diacritics on Duolingo, and fixing the dictionary searches containing decomposed characters.
Typos are detected in seemingly perfectly valid answers:
Searches for existing words (with accented characters) do not return any result:
Duolingo expects answers and dictionary searches to be NFC-normalized strings (see the Unicode Normalization FAQ).
But, depending on the input method, those values may contain decomposed characters, making them internally different from their normalized versions.
For example, the Vietnamese word một (one) can be written in (at least) 3 different ways:
Version | Value | Escaped value |
---|---|---|
NFC | một | m \u1ED9 t |
VN keyboard | một | m \u00F4 \u0323 t |
NFD | một | mo \u0323 \u0302 t |
Normalize the relevant values before they are handled.
The extension lets you choose in the options screen whether to normalize values after each key stroke, or after a more meaningful change. Both options have their pros and cons:
Don't hesitate to post an issue, including as much details as possible, so that I can try to reproduce it!