Appearance
Add a locale
The kit ships English and Spanish. Adding a third is a directory of files and a line of configuration, and nothing else has to change.
1. Offer it
php
// config/laraspring-i18n.php
'locales' => [
'en' => 'English',
'es' => 'Español',
'de' => 'Deutsch',
],The label is written in its own language, because the person who needs it cannot read yours.
This alone is enough to make the language appear in every picker and be accepted by locale.update. Choose it now and the whole interface renders in English: every key falls back, one by one, to the language in laraspring-i18n.fallback. That is the property worth relying on while you translate, because it means a half-finished locale is a screen with some English on it rather than a screen of dotted keys.
2. Translate the kit
Each package keeps its strings under its own namespace, so a locale is one file per package. Copy the English originals and translate them:
bash
cd apps/saas # or apps/vue, whichever edition you have
php artisan vendor:publish --tag=laraspring-auth-lang
php artisan vendor:publish --tag=laraspring-organizations-lang
php artisan vendor:publish --tag=laraspring-billing-lang
php artisan vendor:publish --tag=laraspring-i18n-lang
php artisan vendor:publish --tag=laraspring-storage-lang
php artisan vendor:publish --tag=laraspring-mail-lang
php artisan vendor:publish --tag=laraspring-admin-langThat lands them in lang/vendor/laraspring-<package>/<locale>/, which is the path Laravel already checks before the package's own copies.
A published file stops receiving updates
Publishing takes ownership. A key the kit adds in a later release reaches the package's copy and not yours, and because your copy wins, the new string renders as its key. Publish the locales you are translating and leave the rest alone; vendor:publish --force after an upgrade will show you what changed.
If you only want to add a language rather than change the kit's wording, you can skip publishing and drop the file straight in:
lang/vendor/laraspring-auth/de/auth.php
lang/vendor/laraspring-organizations/de/organizations.php
lang/vendor/laraspring-billing/de/billing.php
lang/vendor/laraspring-i18n/de/i18n.php
lang/vendor/laraspring-storage/de/storage.php
lang/vendor/laraspring-mail/de/mail.php
lang/vendor/laraspring-admin/de/admin.phpNothing else is needed: en stays untouched and keeps updating with the kit.
3. Translate the framework's own strings
Two things in every application are Laravel's rather than the kit's, and they live where Laravel looks for them.
Validation, authentication and the password broker are PHP groups:
lang/de/validation.php
lang/de/auth.php
lang/de/passwords.phpThe Spanish files that ship with the reference edition are a working example. validation.php is deliberately partial: a key it omits falls back to the framework's English, so translating only the rules you actually use is a finished job rather than a corner cut. Its attributes section is what turns ":attribute is required" into a sentence about something a person recognises.
Laravel's own notification wording is keyed by the English sentence and lives in a JSON file:
lang/de.jsonThis is where "Reset Password Notification", "Hello!" and "Regards," go. The split is Laravel's rather than the kit's: PHP groups for structured and namespaced strings, JSON for the framework's inline ones.
4. Check it
bash
cd apps/saas # or apps/vue, whichever edition you have
php artisan test
npm run buildThen sign in, switch to the new language from settings, and walk the flows that send email. The mail preview browser draws every transactional email against fixture data, and it renders in whatever language you are currently in, which makes it the fastest way to read a whole locale's email at once.
Two things to look at rather than assert:
- Button labels. Translations run longer than English, sometimes by half. The theme leaves room for a label to wrap and breaks a compound word that has nowhere to break, but a label that needs three lines is a label to shorten.
- Anything with a number in it.
:countand:secondsland in the middle of a sentence whose word order is not English.