Configuring Live Copy for internationalization
For single-tree, multi-language websites, you must:
-
Use
info.magnolia.livecopy.i18n.LiveCopyI18nContentSupport
in the live copy site definition. This class processes the content of the live copy page based on the locale, programmatically retrieving the locale from the master page’s Site definition.Before version 3.2.6, this class introduced a masterLocale
property which held the fallback language from the master copy. From Live Copy 3.2.6+masterLocale
is deprecated. For older versions of Live Copy, it is still use. -
Enable multi-language authoring in
/config/server/i18n/authoring
and set the class toinfo.magnolia.livecopy.i18n.LiveCopyMultiSiteI18nAuthoringSupport
. -
If you only want to have one locale available in your live copy, delete the other locales from the live copy site definition.
For example, if you have English and German versions in the master, but you only want the German version of the site to be available to authors in the live copy, remove the en locale folder from the live copy site definitions and set the fallback locale to
de
:When the author then opens a live copy page, the language switcher does not appear at the bottom of the page and the content presented is the German version.
About locales
Locales are display languages on Magnolia instances. When you create a live copy of your page, this new page (live copy) adopts the same structure as the original (master). This means that locales
of the master site definition is used to define the structure of both the master and live copy pages. Under the i18n node in the Site app for the respective site definition, you can see which locales (languages) are defined for the site. fallbackLocale
defines which language is used by default from the available locales and which content is served if the content is not available for the current locale.
In the example above, German is used as the default locale for the master page (fallbackLocale = de
). You can read the Internationalization page for more information about translated user interface texts (see examples in the table below).
Master | Live copy |
---|---|
title = Hello world |
title = Hello world |
title_de = Hallo Welt |
title_de = Hallo Welt |
Defining fallbackLocale does not affect the structure of the live copy or the master pages. For example, defining this property as de is like stating that the content of the live copy page will be rendered in the German locale by default when first loaded.
|