Wednesday 28 January 2004 4:31:13 pm
Hi Luis, Again, you can achive #2 using EZP 3, To do what you want at number 2, we use the template operator i18n(), as stated in the thread you mentioned above this operator uses the current language of ezpublish, this is is set at your siteaccess site.ini.append file, here I will try to give you an step by step guide to got it
Premises : If you installed EZP 3 using the normal installation (using the wizard) and tell the installer that you will use two languages, for example English and Portuguese, and the name of your user side site is 'en' (short for English), then at the end of installation you got the file settings/siteaccess/en/site.ini.append that should included something like this :
[ContentSettings] TranslationList=eng-GB;por-PT To create a truly bi-lingual (or multilingual) site you will have to create a siteaccess for each additional language that you need Here the steps to setup a second language in your web site, this is based on our site, so we will use portuguese language to demo
1) Create a new directory under settings/siteaccess, we called 'pt'
2) Copy every file under settings/siteaccess/en/ to settings/siteaccess/pt/
3) Check ownershihp, dir and file permissions on and under 'pt', they should match it on and under 'en'
4) Create a new directory pt under design (you should already have and 'en' directory under design created by ezp installer)
5) Create a directory for overriding images used in the portuguese site, you should already have a design/en/images directory so create a design/pt/images
6) Check in 4 and 5 (step 3) 7) Edit your site.ini.append under pt, changing the following lines:
[SiteSettings] SiteURL=my.domain/index.php/en
[DesignSettings]
SiteDesign=en AdditionalSiteDesignList[]=
[RegionalSettings]
Locale=eng-GB ContentObjectLocale=eng-GB to:
[SiteSettings] SiteURL=my.domain/index.php/pt
[DesignSettings]
SiteDesign=pt AdditionalSiteDesignList[]=uk
[RegionalSettings]
Locale=por-PT ContentObjectLocale=por-PT
8) Edit your general override settings file at settings/override/site.ini.append [SiteSettings] DefaultAccess=en
SiteList[]
siteList[]=en SiteList[]=pt [SiteAccessSettings]
AvailableSiteAccessList[]
AvailableSiteAccessList[]=en
AvailableSiteAccessList[]=pt AvailableSiteAccessList[]=admin
SiteAccessList[]
siteAccessList[]=en
SiteAccessList[]=pt
SiteAccessList[]=admin
9) Clean all EZP caches Now you have setup the basis for a truly bi-lingual (or multilingual) site Check it, opening your main and secondary SiteUrl in you browser, you can translated some content, or use the i18n() operator in your template for some hard coded text The principle is that for opening the SiteURL: my.domain/index.php/pt, EZP will use the templates and images in design/pt if available, else they will use the desing/en templates and images, as design/pt is already empty (no .tpl file and no image files) it actually uses your design/en templates and image, until you add images and templates to the design/pt dir
-----------------------------------------------------------------------------
Regarding the i18n() operator, it will use the .ts file for the language of your siteaccess (defined in your site.ini.append see 'RegionalSettings' at step #7 ), I think is that simple
if it doesn't find the translation string, it will default to the hard code text, normally it is the text in Eng-GB, because EZP uses Eng-GB as its default language
----------------------------------------------------------------------------- To add translations you should use the translation system, the translation system, have a command line tool that goes through your web site .tpl files adding every i18n() hard code text to its database ( the .ts file ), (all of them are stored as Eng-GB text), after that you run its editor (a GUI application) that helps you adding your translations for every term added before, finally the editor will save your .ts file, this is the one you should copy to your web site at share/translations/your_language/translation.ts More information on this at: http://ez.no/developer/ez_publish_3/translations Luis, I'm sorry if I have missed something about the .ts translation, I'm not in charge for this in my team, so I'm learning also :-) OOPS, it seems like I'm writing a book on this, hope this help to get the job done, case not I will resign :-)
Lazaro
http://www.mzbusiness.com
|