Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 2.43 KB

File metadata and controls

66 lines (44 loc) · 2.43 KB

Internationalisation (i18n)

This page covers two distinct i18n concerns:

  1. The admin UI language — the language of the admin interface itself (labels, buttons, messages)
  2. Multilingual content — declaring the locales your application manages, used by the page builder and other bundles

Admin UI language

The admin interface ships with translations for English (en), French (fr), German (de), Spanish (es), Italian (it) and Czech (cs). English is the default.

The language displayed is driven by Symfony's standard default_locale setting. It is en unless you set it otherwise in config/packages/translation.yaml:

framework:
    default_locale: en  # or 'fr', 'de', 'es', 'it', 'cs'

Every shipped locale defines the same set of keys, so the admin is fully translated in each. If you add your own keys and leave a locale incomplete, configure framework.translator.fallbacks to choose what Symfony shows for the gap.


Multilingual content configuration

The AropixelAdminBundle provides a centralized way to declare the languages supported by your application. This configuration is then used by other bundles in the suite (e.g. PageBundle) to enable multilingual features such as the page builder locale switcher.

Configuration

In config/packages/aropixel_admin.yaml:

aropixel_admin:
    translations:
        locales: [fr, en]

You can declare as many locales as needed:

aropixel_admin:
    translations:
        locales: [fr, en, de, es]

Behaviour by locale count

locales value Effect
Empty (default) Single-language mode — no locale switcher anywhere
One locale, e.g. [fr] Single-language mode
Two or more locales Multilingual mode — locale switcher and sync options appear in the page builder

Order matters

The first locale in the list is the primary language. In the page builder, structural changes (adding sections, rows, blocks) made while editing the primary locale are automatically propagated to all other locales when the sync option is enabled.

How it works internally

The aropixel_admin.translations.locales value is registered as the container parameter aropixel_admin.locales. Other bundles in the suite (such as PageBundle) read this parameter at compile time to configure their own multilingual behaviour, so there is no need to declare locales more than once.