Translating your website
Neleto has built-in support for multi-language websites. Translation works on two levels:
- Site languages - configure which languages your site supports, and set a default.
- Translation strings - a key-value store for translated text snippets that you can use inside page and component templates.
1. Configure your site languages
Navigate to Settings and find the Languages section. Here you can:
- Set a Default language - the language used when no other language preference is detected.
- Add additional languages - each with a
value(e.g.de) and alabel(e.g.German). - Enable Auto-detect best language - when enabled, Neleto automatically
selects the best matching language based on the visitor's browser
Accept-Languageheader.
2. Translate pages
Both the title and description can be translated for pages. To do this, change
the language in the page-builder, then you can edit the fields for the selected
language. With this, you can also translate all fields of any element with the
types textarea, richtext and markdown.
3. Manage translation strings
Navigate to Developer tools -> Translations. Here you can manage a key-value store of translated strings that can be referenced inside Handlebars templates.
Each translation entry has:
- A key - a unique identifier used to reference the string in templates
(e.g.
nav.home). This key needs to be the same for all languages of one translation. - A language - the language this value applies to (must match a configured language).
- A value - the translated text.
To use a translation string in a Handlebars template:
{{ translation("nav.home") }}
Neleto will look up the translation for the current page's language at render time. If no translation is found for the current language, the default language's value is used as a fallback.
You can also import translations from a JSON file using the Import button in the translations view. The expected format is a flat object with keys mapping to translated strings:
{
"nav.home": "Home",
"nav.about": "About us"
}