Block Localization
Block localization is available starting from version 18.5.6. Translation can be performed to any number of languages. The following is required localization:
- Create a block for language of your selection.
- And two keys in manifest:
'lang' => [ 'en' => [ 'Titulo con separador y un fon claro' => 'Title with a separator on a light background (translated)' ], 'de' => [ 'Titulo con separador y un fon claro' => 'Überschrift mit einem Trennzeichen auf einem hellen Hintergrund' ] ], 'lang_original' => 'es'
Where:
lang_original – original language used to create the block manifest. Attention: phrases in the manifest specifically.
lang – minimum one language (from all other languages available). There is no restriction to create blocks for example for only French or German-speaking visitors.
The keys of the lang array list all possible variants for the 'name' field in your manifest. It can be the name of the block itself, names of nodes, styles, attributes and their values.
The system scans the complete manifest and upon encountering a name key, searches an appropriate replacement for it in the language array (either the current langue, or en, when the account language differs from the block original language).