laravel-lang/json-fallback
Adds a JSON fallback translator to Laravel so missing JSON translation keys resolve to your fallback locale instead of showing raw keys. Drop-in service provider, no config required.
Architecture fit
lang/{locale}.json), replacing Laravel's default JSON loader with one that resolves missing keys against a configured fallback locale. PHP array translations are untouched — Laravel's native fallback already covers those.__() output but has no way to compute a fallback itself.fr-CA → fr-FR → en). If our i18n design assumes tiered fallbacks or provider-based loaders, this package is a partial fit at best.Integration feasibility
__(), @lang, trans()) stays identical, which keeps blast radius small and makes a pilot cheap (~a day including validation).Technical risk
json-fallback-hotfix). This is a bus-factor-1 dependency with effectively no ecosystem signal. Mitigant: MIT license plus a tiny, well-bounded code surface — we can vendor or reimplement in an afternoon if the project stalls. That, more than the star count, is what makes the risk tolerable.Key questions
JsonLoader (e.g., a DB-backed translation provider, Inertia/SPA translation pipeline) that would conflict?Stack fit
en) is acceptable.Migration path
jsonlint (or equivalent) to CI.config/app.php; confirm it matches product intent, not just a default.?? 'default' fallback code found in Blade/JS during step 1.Compatibility
lang:publish tooling and with any package that decorates the translator.Sequencing
Maintenance
Support
Scaling
pt-BR/pt-PT, zh-Hans/zh-Hant with chains), plan for a wrapper or a custom loader now rather than retrofitting later.Failure modes
JsonLoader; symptoms are fallbacks silently not working. Verify in a staging smoke test that a deliberately missing key resolves.Ramp-up
How can I help you explore Laravel packages today?