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",
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 localeit
, no overwrite existing translations, verbose on,json
instead of PHP output):This should be:
"Export course": "Corso sull'esportazione",
The cause of this is the call to
addslashes()
in this line: https://github.com/tanmuhittin/laravel-google-translate/blob/80e3e408d02283ff000832e672a9bcebda194902/src/TranslationFileTranslators/JsonArrayFileTranslator.php#L39This is unnecessary, as
json_encode
, which is called on line 48, already takes care of the necessary escaping.