Skip to content

[Bug]: JSON translations incorrectly marked as missing #419

@Aridez

Description

@Aridez

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

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions