joedixon/nova-translation
A Laravel Nova tool for managing translations directly from your admin panel. Browse and edit language files, scan for missing translation keys, and keep JSON and PHP translations organized without leaving Nova.
This is the first stable release (v1.0.0), so treat it as an initial evaluation rather than an upgrade. The two changes — an updated Laravel translation dependency and Laravel 6 support — tell you the package is built on top of Laravel’s native translator/loader contracts and is intended to be a drop-in extension of __() / @lang, not a replacement API.
Start here:
composer require the package, then read its composer.json to confirm the Laravel 6 constraint (^6.0) and PHP requirement (Laravel 6 requires PHP >= 7.2). Because Laravel 6 uses package auto-discovery, check the extra.laravel.providers entry; if the package predates discovery you may need to register the service provider manually in config/app.php.php artisan vendor:publish --provider="...ServiceProvider") and read the config file top to bottom before changing anything. The important keys are the translation driver/source, fallback locale, and any cache settings.__('group.key') in php artisan tinker. If the string resolves, the custom loader is registered correctly and you can build on it.The first real use case is usually one of two things: moving translations out of flat lang/ files into a database so non-developers can edit them, or adding a translation source that Laravel’s default file loader doesn’t cover. Confirm which one the package targets before designing around it.
Use it behind the native translator. The main value of a package like this is that application code should not change. Keep calling __(), @lang, and trans_choice(); let the package’s loader resolve keys. This keeps you portable if you later swap the source.
Database-backed translations. A common pattern is a translations table keyed by locale, group, and key, with a model that the package’s loader queries. Seed it from existing lang/ files during migration, then treat the database as the source of truth. Keep a group column so __('auth.failed') maps cleanly to group = auth, key = failed.
Cache aggressively, invalidate on write. Translation lookups happen on nearly every request, so load all translations for a locale once and cache them (Laravel’s cache repository keyed by locale works well). Invalidate the locale’s cache in the model’s saved and deleted events rather than trying to expire by TTL. This is the single biggest performance lever.
Fallback and missing-key behaviour. Configure fallback_locale in config/app.php and let the package fall through to it. Decide up front whether missing keys should throw, log, or return the key itself; if the package exposes a “missing translations” hook, wire it to your logger so gaps are visible in staging.
Import/export workflow. If the package ships artisan commands for syncing files and the database, run export in CI to catch drift and import as part of deploy. If it doesn’t, write a small command that wraps the loader rather than duplicating key-parsing logic.
Locale-aware testing. In feature tests, use app()->setLocale() and assert against real keys. Add one test that asserts the database loader is used (e.g. change a row and see the resolved string change) so a config regression doesn’t silently fall back to flat files.
php artisan config:clear. A stale cached config makes it look like the package is ignoring your changes.group.key and nested arrays differently from a flat database table. Pick one convention (dot-notation, explicit group column) and enforce it in your import command, or you’ll get duplicate and orphaned rows.illuminate/translation that conflicts with older or newer framework versions. Check composer why-not if you’re on 5.x or 7+.fr quietly returning the en string is convenient in production but hides incomplete translations. Log fallback hits in non-production environments.How can I help you explore Laravel packages today?