-
-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
For values where the translation contains an apostrophe ('), a double escape character is added (\\); this will create a backslash in front of the apostrophe when rendered in the web page.
For example (from base locale en to target locale it, no overwrite existing translations, verbose on, json instead of PHP output):
"Export course": "Corso sull\\'esportazione",
This should be: "Export course": "Corso sull'esportazione",
The cause of this is the call to addslashes() in this line:
laravel-google-translate/src/TranslationFileTranslators/JsonArrayFileTranslator.php
Line 39 in 80e3e40
| $translated_strings[$to_be_translated] = addslashes(Str::apiTranslateWithAttributes($to_be_translated, $target_locale, $this->base_locale)); |
This is unnecessary, as json_encode, which is called on line 48, already takes care of the necessary escaping.
dyoh777
Metadata
Metadata
Assignees
Labels
No labels