<HTML>
<HEAD>
<TITLE>Re: [opencms-dev] OpenCMS website localization</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12pt'>Hi Michael, <BR>
<BR>
Thanks a lot for sharing! Very interesting, indeed. The link substitution handler sounds like something we could use, as well. <BR>
<BR>
Cheers, <BR>
<BR>
Martin<BR>
<BR>
<BR>
On 18/09/2008 11:33, "Michael Moossen" <<a href="m.moossen@alkacon.com">m.moossen@alkacon.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12pt'>Hi,<BR>
<BR>
I just want to share my experience with content localization.<BR>
<BR>
As far as i know all projects developed by Alkacon (normally i work<BR>
developing the core) that had to deal with localization were using the<BR>
several folders with siblings approach. Which is, in my opinion, quite<BR>
easy to setup but not to maintain, despite some project were also<BR>
including different approaches to automatic sibling creation.<BR>
<BR>
So when i started to develop my first website from scratch with OpenCms<BR>
(<a href="http://www.moossen.net/">http://www.moossen.net/</a>) a couple of weeks ago, i tried a different<BR>
approach.<BR>
And i thought it would be enough with a single folder structure for all<BR>
locales, a 10 LOC locale handler (see<BR>
org.opencms.i18n.I_CmsLocaleHandler) and a cookie.<BR>
<BR>
But this turned out to be a very bad and naive idea, mainly because one<BR>
URL is having different content:<BR>
- try to flush browser cache when the user changes the locale.<BR>
- try to tell google that he has to set a cookie for indexing different<BR>
languages.<BR>
- The same applies also for the static export, and everything else...<BR>
<BR>
so, for now i am just appending a meaningless lang parameter to every<BR>
url, which is working but awful :(<BR>
<BR>
But i learnt by heart that you MUST have different URLs for different<BR>
locales.<BR>
<BR>
My next try will be (as soon as i get the time for it) to implement a<BR>
resource initialization handler (see org.opencms.main.I_CmsResourceInit)<BR>
with a link substitution handler (see<BR>
org.opencms.staticexport.I_CmsLinkSubstitutionHandler).<BR>
<BR>
The idea is to have in OpenCms a single folder structure that will look<BR>
to the outside world like several folders for the locales.<BR>
<BR>
On one side, the resource initialization handler will intercept the<BR>
requests and remove the leading locale folder from the URL (if you<BR>
request /en/index.html, it will read the OpenCms resource at /index.html).<BR>
<BR>
And the link substitution handler will generate the links with a locale<BR>
folder prefix. (if in /index.html you have a link to /about/contact.html<BR>
(and let say the selected locale is en (with a cookie, for instance), it<BR>
will generate in the html output a link to /en/about/contact.html.<BR>
<BR>
I hope this will workout as i expect, and i was just checking the API<BR>
and it seems to be easier to implement than i thought, so i better start<BR>
to code now ;)<BR>
<BR>
Hope that helps<BR>
<BR>
Kind regards,<BR>
Michael<BR>
<BR>
<BR>
<BR>
Carl Alex Friis Nielsen wrote:<BR>
> No - the content resides in the resource.<BR>
> The locale property can be set by simply having all material that shall<BR>
> be available for a given<BR>
> locale under a folder with its locale property set to the desired locale.<BR>
> It really is quite simple to set up and use.<BR>
><BR>
> -----Original Message-----<BR>
> *From:* <a href="opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a><BR>
> [<a href="mailto:opencms-dev-bounces@opencms.org]*On">mailto:opencms-dev-bounces@opencms.org]*On</a> Behalf Of *Martin Wunderlich<BR>
> *Sent:* Monday, September 15, 2008 11:57 AM<BR>
> *To:* The OpenCms mailing list<BR>
> *Subject:* Re: [opencms-dev] OpenCMS website localization<BR>
><BR>
> OK, but that means the content needs to be externalised to<BR>
> properties files, right? In our case, we non-technical people<BR>
> creating the original English content and they wouldn’t necessarily<BR>
> know how to work with properties files.<BR>
><BR>
> Cheers,<BR>
><BR>
> Martin<BR>
><BR>
><BR>
> On 15/09/2008 10:35, "Carl Alex Friis Nielsen" <<a href="cfn@kb.dk">cfn@kb.dk</a>> wrote:<BR>
><BR>
> You have multiple locales in the same resource.<BR>
> Which locale is displayed depends on the locale property of the<BR>
> resource.<BR>
> Different siblings can have different locale properties.<BR>
> The properties can be inherited from the folder hierachy in the VFS.<BR>
><BR>
> AFAIK this is a very widely used way to handle multilingual<BR>
> content in OpenCms.<BR>
><BR>
><BR>
> -----Original Message-----<BR>
> *From:* <a href="opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a><BR>
> [<a href="mailto:opencms-dev-bounces@opencms.org]*On">mailto:opencms-dev-bounces@opencms.org]*On</a> Behalf Of<BR>
> *Martin Wunderlich<BR>
> *Sent:* Monday, September 15, 2008 11:11 AM<BR>
> *To:* The OpenCms mailing list<BR>
> *Subject:* Re: [opencms-dev] OpenCMS website localization<BR>
><BR>
> Hi Steve,<BR>
><BR>
> Are you saying that you’re using the siblings mechanism for<BR>
> content in different languages? How would that work? AFAIK,<BR>
> siblings are basically pointers to the exact same content.<BR>
><BR>
> About the web services interface, does OpenCms somehow<BR>
> support SOAP calls at the moment?<BR>
><BR>
> Kind regards,<BR>
><BR>
> Martin<BR>
><BR>
><BR>
> On 15/09/2008 10:01, "Steve Bryan"<BR>
> <<a href="steve@bright-interactive.com">steve@bright-interactive.com</a>> wrote:<BR>
><BR>
><BR>
><BR>
> Hi<BR>
><BR>
> One usability problem we found is that when an editor<BR>
> creates a page in one<BR>
> language folder (eg under en), the siblings do not get<BR>
> created automatically<BR>
> in the other language folders (which for us is<BR>
> generally required except for<BR>
> the odd case that the pages are only in one of the<BR>
> locales).<BR>
><BR>
> One solution to this would be to customize OpenCms to add a<BR>
> 'copy-to-all-locales' function, either on the create<BR>
> dialog or (more easily)<BR>
> as a separate context menu function. The latter can be<BR>
> done by adapting the<BR>
> regular copy function to copy out siblings to the other<BR>
> locale folders.<BR>
><BR>
> An associated problem (which I think Martin is<BR>
> referring to), is that title<BR>
> & navtext properties etc would normally need to be<BR>
> translated as well as<BR>
> elements of pages and structured types. One work-around<BR>
> for this, is to add<BR>
> title and nav-text page elements, and use them instead<BR>
> of the properties in<BR>
> the template navigation. The ideal is to ensure that<BR>
> all properties are<BR>
> locale independent (and hence a straight sibling copy<BR>
> does the job). Any<BR>
> locale dependent stuff should go in page elements. Then<BR>
> only the page bodies<BR>
> need translation.<BR>
><BR>
> After that, we have a batch translation system that<BR>
> sounds like a much less<BR>
> advanced version of Martin's :-) - ie exporting pages,<BR>
> getting the<BR>
> translation company to fill in the control code, then<BR>
> re-importing. The web<BR>
> services idea sounds good.<BR>
><BR>
> Steve<BR>
><BR>
><BR>
> ----------------------------------------------------------------------<BR>
><BR>
> Date: Fri, 12 Sep 2008 11:23:52 +0100<BR>
> From: "Martin Wunderlich" <<a href="mwunderlich@salesforce.com">mwunderlich@salesforce.com</a>><BR>
> Subject: Re: [opencms-dev] OpenCMS website localization<BR>
> To: "The OpenCms mailing list" <<a href="opencms-dev@opencms.org">opencms-dev@opencms.org</a>><BR>
> Message-ID: <<a href="C4F001C8.2D0D%mwunderlich@salesforce.com">C4F001C8.2D0D%mwunderlich@salesforce.com</a>><BR>
> Content-Type: text/plain; charset="iso-8859-1"<BR>
><BR>
> Hi David,<BR>
><BR>
> We currently have 17 different locales on our website<BR>
> (5 of them English<BR>
> language) and it works somehow like this:<BR>
><BR>
> * The localised sites are located under sub folders<BR>
> of the main domain,<BR>
> whereby the subfolder name consists of the ISO country<BR>
> ID, e.g.<BR>
> www.salesforce.com/es for Spanish.<BR>
> * Some locale specific content is externalised to<BR>
> properties files, but<BR>
> not the main body text of the pages.<BR>
> * Translation is generally a one way street from<BR>
> en-US to all the other<BR>
> locales.<BR>
> * To get a web page translated, we run an export<BR>
> that picks up the<BR>
> respective pages, based on a custom property that we<BR>
> have included in the<BR>
> templates. The export file then gets dumped to an FTP<BR>
> server, from where it<BR>
> is picked up every so often by the translation<BR>
> management system (feels a<BR>
> bit ancient, IMHO; this should happen in real time<BR>
> through a web services<BR>
> interface). We do some automated tweaks to the<BR>
> manifest file of the export<BR>
> file (replace locales IDs and such) and then import<BR>
> back into OpenCms.<BR>
><BR>
> Some things that I really miss are better support for<BR>
> image localisation,<BR>
> the web services interface mentioned above, and a<BR>
> better OpenCms interface<BR>
> for sending files for translation. Also, it would be<BR>
> great to have a WYSIWYG<BR>
> interface for externalising information to properties<BR>
> files, so that<BR>
> non-technical content editors can create properties on<BR>
> the fly.<BR>
><BR>
> Cheers,<BR>
><BR>
> Martin<BR>
><BR>
><BR>
> On 01/09/2008 11:41, "David Valls roure"<BR>
> <<a href="david.valls@sogeti.com">david.valls@sogeti.com</a>> wrote:<BR>
><BR>
> Hi All,<BR>
><BR>
> i'm having some issues regarding web site localization<BR>
> and I want to<BR>
> review if i'm doing well...<BR>
><BR>
> This are my steps:<BR>
> 1.- new folder www at /sites/default<BR>
> 1.1.- properties-advanced-locale: en<BR>
> 2.- some content-> pages with free text<BR>
> 3.- new folder news at www<BR>
> 4.- add some news inside<BR>
><BR>
> ok, now i have my website in english<BR>
><BR>
> How to localize?<BR>
><BR>
> 1.- copy all, even siblings from www to www_es<BR>
> 2.- Administration-> Merge pages -> from www 2 www_es<BR>
> 3.- Change locale-> www_es (include subfolders) from en<BR>
> 2 es<BR>
> 4.- Open website and traduce all...<BR>
> That's what i've done.<BR>
><BR>
> repeat this steps for other languages...<BR>
><BR>
> The first thing i want to know if i'm doing well...<BR>
> because now i have<BR>
> a problem: when i add content like pages with free text<BR>
> i can merge<BR>
> and goon, but with news i cannot localize them... i<BR>
> can't copy them to<BR>
> corresponding language folder...<BR>
><BR>
> How do i create localized (multilanguage) sites?<BR>
> How do i mantain localized (multilanguage) sites?<BR>
><BR>
> Thanks in advice,<BR>
><BR>
> David.<BR>
><BR>
><BR>
><BR>
><BR>
><BR>
> _______________________________________________<BR>
> This mail is sent to you from the opencms-dev mailing list<BR>
> To change your list options, or to unsubscribe from the<BR>
> list, please visit<BR>
> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><BR>
><BR>
><BR>
><BR>
> ------------------------------------------------------------------------<BR>
><BR>
><BR>
> _______________________________________________<BR>
> This mail is sent to you from the opencms-dev mailing list<BR>
> To change your list options, or to unsubscribe from the list, please visit<BR>
> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><BR>
<BR>
_______________________________________________<BR>
This mail is sent to you from the opencms-dev mailing list<BR>
To change your list options, or to unsubscribe from the list, please visit<BR>
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>