- eZ Publish 4: Enterprise Web Sites Step/by/Step
- Francesco Fullone Francesco Trucchia
- 323字
- 2021-04-01 13:49:16
Creating multilingual siteaccesses
As we saw, eZ Publish created a siteaccess for every language that we enabled in the first chapter. If we'd like to add more languages for our site, we need to create a new siteaccess folder and configure the language settings inside it.
Let's create, for example, a German siteaccess. This task can be summarized in the following three steps:
- Create a new folder called
de
, insidesettings/siteaccess/
. - Copy the files or create the appropriate symbolic links as per the
eng
siteaccess, inside thede
folder. - Configure the siteaccess
.ini
configuration files for the language.
Copying the configuration file
We need to create all of the .ini
files from the main language siteaccess in the new language folder (de
). To do this, we need to create a symbolic link for all the files, except the site.ini.append.php
, that are to be copied into the new folder.
Configure all of the site.ini.append.php
files for all of the languages siteaccesses, to enable the new German language.
To do this we will edit the files, adding the highlighted code:
# vi settings/siteaccess/eng/site.ini.append.php [RegionalSettings] Locale=eng-GB ContentObjectLocale=eng-GB ShowUntranslatedObjects=enabled SiteLanguageList[]=eng-GB SiteLanguageList[]=ita-IT SiteLanguageList[]=fre-FR SiteLanguageList[]=de-DE TextTranslation=disabled
Do the same for the site.ini.append.php
files in the fre
folder and the ita
folder.
After that, we need to copy the eng/site.ini.append.php
to our new folder, de
, and edit it as follows:
[RegionalSettings] Locale=de-DE ContentObjectLocale=de-DE ShowUntranslatedObjects=enabled SiteLanguageList[]=de-DE
SiteLanguageList[]=eng-GB
SiteLanguageList[]=ita-IT
SiteLanguageList[]=fre-FR
TextTranslation=enabled
The directive SiteLanguageList
tells us the order in which the system will show the content for our objects. If the content isn't translated into German, eZ will show the English version; if the English version is unavailable than it will show the Italian one, and so on.
The last step is to add the new languages inside the settings/override/site.ini.append.php
, as we did for the dev
and staging siteaccesses:
[SiteSettings] .. SiteList[]=fre SiteList[]=ita SiteList[]=eng SiteList[]=de [SiteAccessSettings] .. AvailableSiteAccessList[]=fre AvailableSiteAccessList[]=eng AvailableSiteAccessList[]=ita AvailableSiteAccessList[]=de .. RelatedSiteAccessList[]=fre RelatedSiteAccessList[]=eng RelatedSiteAccessList[]=ita RelatedSiteAccessList[]=de
- GIMP 2.6 cookbook
- SolidWorks 2021中文版機械設計從入門到精通
- Python Text Processing with NLTK 2.0 Cookbook: LITE
- 中文版AutoCAD 2022基礎教程
- 碼上學會:中文版Creo 3.0機械設計全能一本通(雙色版)
- SolidWorks 2018快速入門及應用技巧
- Spark Cookbook 中文版
- Photoshop CC 2017 淘寶美工設計實例教程
- SolidWorks 2015中文版機械設計從入門到精通
- Oracle Modernization Solutions
- SolidWorks上機實踐經典40例
- Business Process Driven SOA using BPMN and BPEL
- Photoshop CC 2018基礎與實戰教程
- GraphPad Prism學術圖表(全彩)
- AutoCAD 2012建筑設計與制作標準實訓教程