[opencms-dev] Multilingual sites - Browser's AcceptedLanguages

Christian Steinert christian_steinert at web.de
Sat Jul 15 14:04:20 CEST 2006


Peter Olsson schrieb:
> Hi again!
> 
> I'm now in the next step towards using OpenCms for a multilingual site.
> And that is the navigation.
> 
> If I had chosen a solution with siblings I guess this had worked just
> fine by setting the file properties Navigation Text and Title for the
> different siblings. But now I didn't :-)
> 
> Have any of you any experiences in this area you could share?
> 
> I have seen suggestions about using both ResourceBundles and define new
> properties for each language in the files (Title_de, Title_sv, ...). 
I don't see the connection between resource bundles and file properties.

If you have static pieces of text that are alway there, but of course
different for each language, then you use one resource bundle, make sure
that your keys don't collide with those of opencms and that's that.


If you have NAVIGATION info, then you usually store it as file
properties of your files. You cannot store more than one language per
sibling anyway, so I don't see where siblings would help you (compared
to just having independent replicas in the other languages) with pulling
out the navigation info in a way that works with the accept language.
(Corrections are welcome, if somebody thinks that there is a more
elegant solution than having two siblings as containers for the language
related file properties.)

But
> since I'm still unexperienced with OpenCms I can't yet see what the
> consequences of the different solutions are in other parts of OpenCms.
> 
> My idea is that the navigation should be translated in a process of its
> own. That is, the navigation should be available in the chosen language
> even if the file/folder it links to isn't yet translated.
I think that I understand the problem, but I don't know of an easy
solution. Of course you can have replicas or siblings for a given page
in another language - even before the content has been translated to
that language. But opencms does not help you with replicating anything
across languages.

I implemented something like this by creating my own resource type, but
I'm afraid that the code is too specific and it took so long to get it
to work that I don't know whether I can recommend that approach...

I hope you understood you correctly. I think the handling of
cross-language file properties and the inability to replicate siblings
to other languages, if they are created in one languages are currently
the biggest weaknesses when trying to create multilanguage sites.

On the other hand I don't know if there's an easy solution, because I
don't know if everybody has the same expectations of how file property
internationalization should work if if were better supported...

Regards
Christian
> 
> /Peter
> 
> PS: The solution with a new LocaleHandler seems to work fine and I
> choose to made the locale of a file, if it is defined, have precedence
> over the browser's Accept-Locale setting. Therefore it also work with
> the sibling approch. I made it as a module and there where no need to
> change and recompile the core.
> 
> PS 2: The site http://www.jugglingdb.com/ have a similar approach to
> what I want OpenCms to fix for me.
> 
> Peter Olsson wrote:
>> Hi,
>>
>> I found an earlier posting about this with the code for an alternative
>> LocaleHandler
>> (http://mail.opencms.org/pipermail/opencms-dev/2004q4/014031.html)
>> which gives the behavior I want. That is, the locale from the
>> Accept-Language setting of the browser is used if it is one of the
>> configured languages. I also get the functionality for the user to set
>> the preferred language explicitly.
>>
>> But is this the right path to go?
>> Or can this be done in some other way?
>>
>> I also get an automatic fallback if there is no translation of a
>> specific element in the preferred language of a page. That is, the
>> elements that are not translated will be in English.
>>
>> /Peter
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060715/21eb95ad/attachment.bin>


More information about the opencms-dev mailing list