Skip to content

Conversation

@N1ebieski
Copy link
Contributor

@N1ebieski N1ebieski commented Jun 9, 2025

Fixes #400

This PR depends on laravel/vs-code-php-parser-cli#21

Currently, the translations.php template uses json_encode without any flags. As a result, during serialization to JSON, all symbols and slashes are escaped. For example:

Products → Settings => Products \u2192 Settings

API / ERP => API \/ ERP

then linkProvider cannot find such elements in the translation repository, because VsCode returns raw, unescaped keys.

This PR adds 2 additional flags to json_encode: JSON_UNESCAPED_UNICODE and JSON_UNESCAPED_SLASHES. I'm not 100% sure but I think, both javascript object and php array can use symbols and slashes in the property/key names, so there should be no conflict.

Copy link
Collaborator

@joetannenbaum joetannenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thank you!

@joetannenbaum joetannenbaum merged commit 59678dc into laravel:main Jun 9, 2025
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.

[Bug]: Translation not found when contains non-standard character

2 participants