Localization
- Introduction
- Managing locales
- Enable localized content for fields
- How to localize content
- How to localize the administration panel
Introduction
Use Cockpit's locales settings and localization features whenever you need to translate your content in content items.
Locales define the languages you want to use in your content. Define and use locals whenever you want to provide content in different translations.
Managing locales
You can set up localization as described in the following steps:
- Login to your Cockpit installation
- Navigate to Settings > Locales
- See the list of locales, that have already been created
- Add new locales or modify existing locales
Enable localized content for fields
In order to localize content you need to enabled localization by activating the localize field option foreach field you want to localize on your content models.
How to localize content
After you enabled localize field as described in Enable localized content for fields the field can be translated using any of your Locales.
- Login to your Cockpit installation
- Navigate to Content
- See the list of collections and singletons
- Click the collection you want to add or modify content for
- Display the locales you want to translate in the right section called Translation
- Provide different content foreach localized field
- That's it. Localized content will be available from Cockpit's API
How to localize the administration panel
Before you start check if your desired translation / language is already available in the i18n repository.
If the translation is already available:
Copy the translation to the /config/i18n/
folder.
If the translation is not yet available:
Create new empty localization files by running php ./tower app:i18n:create
from the root directory of Cockpit. After that manually translate all strings in the files.
Lastly sign-in to the administration panel and choose the desired language for your user(s) in the account settings under "Admin UI language".