Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode PHP strings to prevent slashes in output #296

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

q--
Copy link

@q-- q-- commented Feb 27, 2024

Decode PHP strings, so in the final JSON e.g. __('Don\'t') becomes "Don't" instead of "Don\\'t"

Steps to reproduce:

Blade file

({{ __('This is a text with an apostrophe in it; let\'s add it to my translations file!') }})

Run php artisan translation:sync-missing-translation-keys

How laravel-translation stores it in <language>.json after running that:

"This is a text with an apostrophe in it; let\\'s add it to my translations file!": "",

What it should be storing:

"This is a text with an apostrophe in it; let's add it to my translations file!": "",

Decode PHP strings, so in the final JSON e.g. __('Don\'t') becomes
"Don't" instead of "Don\\'t"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants