scratchfoundation / scratch-www

Standalone web client for Scratch
https://scratch.mit.edu
BSD 3-Clause "New" or "Revised" License
1.59k stars 844 forks source link

Don't use unicode curly quotes in localization strings #1238

Open chrisgarrity opened 7 years ago

chrisgarrity commented 7 years ago

Unicode quotes should not be escaped in the JSON. Unfortunately it is easy for translators insert regular quotes that do need to be escaped into the translation, For this reason we should avoid using unicode quotes.

Sheshank-s commented 6 years ago

Is this still an issue? If so I can make a pull request..

thisandagain commented 6 years ago

@chrisgarrity ^^

chrisgarrity commented 6 years ago

@GreenBayRules yes, this looks like it's still an issue.

Sheshank-s commented 6 years ago

Okay, I'll get t o work on it right now :D

Sheshank-s commented 6 years ago

PR: #1683 :D

chrisgarrity commented 6 years ago

@GreenBayRules description is updated to reflect how we've decided to deal with unicode quotes

Sheshank-s commented 6 years ago

Okay thanks, I'll submit a pr in a wihile.

LiFaytheGoblin commented 6 years ago

So we want this: \" instead of any unicode quotes like or ?

chrisgarrity commented 6 years ago

@LiFaytheGoblin in our source files l10n.json we should only use \".

Technically, the unicode curly quotes are perfectly fine in json, so if a translator wants to use them, it still works.

The problem is that it's very easy not to notice that the quotes are the special unicode quotes, so if someone later replaces them with normal double quotes without adding the escape backslash it causes syntax errors in the json file for that language. Any syntax error causes the whole file to get rejected, so all translations for that language are rejected.