Skip to main content
Version: Legacy

Managing Locales

warning

Out of the box, Laravel doesn't allow fallback translations for JSON keys. For example, when you call __('Remember Me'), you get Remember Me instead of Se souvenir de moi for French fallback language.

Almost all console commands take an array of localizations as parameters.

For example:

php artisan lang:<command> fr de de_AT de_CH vi zh_CN
php artisan lang:<command> fr
php artisan lang:<command>

Where:

  • fr de de_AT de_CH vi zh_CN it's a list of locales separated by a space;
  • fr it's also possible to specify a single localization name;
  • if the parameter is not passed during the call, the script will ask two questions:
  • Do you want to %s all localizations?, when %s is install, remove or reset;
  • If no, then next question is Select localizations to add (specify the necessary localizations separated by commas).
note

When performing any work with files (install, uninstall, reset and update), in addition to php files, work with json files, including translation for Laravel Framework, Jetstream, Fortify, Cashier, Breeze, Nova (also Dusk Suite and Log Viewer), Nova (also Dusk Suite, Log Viewer ) and UI, will also be automatically performed.