Running a site
Languages and translations
Content in every language, and every label in the admin.
Languages
- Adding languages: in Settings › Languages & sites. The default language has no address prefix; the others get one, which may differ from the code (
nbat/no). - What's translated: page titles, addresses, summaries, SEO fields and block text, menu item titles, form field text, media alt text and captions, role names and every label.
- Per page: tick which languages it exists in. A page only answers in those, and links to an untranslated page go to its default language.
- The admin's language is each person's own choice, separate from the website's.
A page's address in each language
A page has its own address in every language: its slug is stored per language, and edited per language in the page form. In code:
use Aurora\Support\ContentLocale;
$page->path('nb'); // /no/om-oss
$page->url('nb'); // https://example.com/no/om-oss
ContentLocale::current(); // the language being shown, such as nb
ContentLocale::prefix('nb'); // /no (empty for the default language)
Routes of the website's own in more than one language are under Routing.
What's translated in a block
- Translated: a block's text fields: text, multi-line text, rich text, Markdown, tags, and lists whose items have text.
- The same in every language: everything else, such as links, numbers, images, settings and lists of selected records.
- Text that isn't translated, such as a record's id or a handle typed into a text field, goes in the block's
sameInEveryLanguage(). - Same in … v1.2.0: text that reads the same in a translation, such as a name, is marked so in the inspector, and then counts as translated.
Translations
The Translations screen holds every label in the website and the admin, Aurora's, Laravel's and other packages', editable in place, one tab per language, with a count of what's missing.
- Filters: needs translation, where a label comes from, and edited here.
- Per label: edit every language at once, or reset to the lang file.
- For the whole list: Translate all with AI, Import from lang files (keeps edits) and Remove unused.
- Missing labels fall back to the default language.
Which label wins
- A label edited under Translations in the admin.
- The app's own
lang/{locale}.json. - Aurora's and the other packages' labels.
So a site's own line in lang/nb.json is the label straight away, whatever Aurora's says, with nothing to import. On the command line, aurora:sync-translations adds new labels from the code, aurora:import-translations lists the lang files' labels in the Translations screen (it only fills that screen) and aurora:export-translations writes edits made in the admin back to the lang files.