You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Placeholder 0 is shown as "404" in non-English locales (Laravel 12) #16111
In any locale with a JSON translation file containing the key "404" (all non-English Statamic translations do), a placeholder of 0 is displayed as "404". Example: the "Min Value" setting of the form builder's Opinion Scale field (src/Forms/Fieldtypes/OpinionScale.php, 'placeholder' => 0).
Cause:
IntegerFieldtype.vue translates the placeholder: :placeholder="__(config.placeholder)".
On Laravel 12, FileLoader::loadJsonPaths() merges JSON translations with array_merge, which renumbers numeric keys. The key "404" becomes 0.
The Control Panel's translations then contain '*.0' => '404', so __(0) and __('0') both return "404".
Laravel 13 preserves numeric keys (laravel/framework#61925), but Statamic 6 also supports Laravel 12, where this still happens.
Suggested fix in Statamic: don't pass numeric placeholders through __() (e.g. only translate strings that aren't numeric).
fixes it. Numbers like 0 and '0' are shown as they are, and text placeholders still get translated. A quick vitest with setTranslations({ '*.0': '404' }) shows "404" before the change and "0" after.
Fixing it in the JS translator instead wouldn't work, because on Laravel 13 a key like "404" is a real translation and has to keep working.
Activity
lazerg commentedon Dec 1, 2026
I can reproduce this. In
resources/js/components/fieldtypes/IntegerFieldtype.vue, changing the placeholder binding tofixes it. Numbers like
0and'0'are shown as they are, and text placeholders still get translated. A quick vitest withsetTranslations({ '*.0': '404' })shows "404" before the change and "0" after.Fixing it in the JS translator instead wouldn't work, because on Laravel 13 a key like "404" is a real translation and has to keep working.