-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
Extension Version
1.0.11
PHP Binary
Local PHP
Operating System
Windows
What happened?
A warning is being thrown when using translations in JSON files, on all existing translations in a blade view, regardless of whether they exist or not.
To verify the issue, I disabled all other extensions and kept only the official Laravel extension active. After testing different versions, I found:
- The problem begins with version
v1.0.8
and persists through to the latest release at the time of writing (v1.0.11
) - Version
v1.0.7
does not have this issue and correctly highlights only the translations that are actually missing
Skimming through existing issues I do not see one that addresses this specifically
- [Bug]: Translation not found warning #406 references translations with a numeric keys and should be solved in Fix for translations with numeric keys #407
- [Bug]: Translation Linting is not greedy enough #370 references to translations in attributes and should be solved in Support for parser for blade component attributes #344
- Other issues seem to refer to PHP strings translations
Mimimal Code Sample
Installing a fresh Laravel 12 instance then doing php artisan lang:publish
, the modified lines are the following:
resources\views\welcome.blade.php
<p class="mb-2 text-[#706f6c] dark:text-[#A1A09A]">
{{ __('Laravel has an incredibly rich ecosystem.') }}
<br>
{{ __('We suggest starting with the following.') }}
</p>
lang\en.json
(created):
{
"Laravel has an incredibly rich ecosystem.": "Laravel has an incredibly rich ecosystem."
}
Both translations are marked as missing on v1.0.11
while on v1.0.7
only the second one is correctly marked as missing.