[opencms-dev] Multilingual NavText

Thomas Göttlich guo.tuomi at googlemail.com
Fri Oct 14 11:30:29 CEST 2011


Hi,

I know this is a commonly asked question but since I couldn't find anything
helpful in the wiki or using google yet, I'll ask my question here:

How can I maintain a folder's navtext property in a multilingual way?

We currently have a site that consists of one tree and structured content
containing mutliple languages.
Our templates use a fallback mechanism to retrieve content in the default
language (English) if there's no content for the requested language (e.g.
German).
This works on a per-field basis, i.e. you could, for example, set some
images in the default language only and just translate the text in the other
supported languages.

Because of this, and since it is a much cleaner approach IMHO, we don't want
to fiddle around with different structures in multiple languages (i.e. no
siblings!).

All worked fine so far, since we didn't use the OpenCMS navigation
facilities yet.

However, now we need to employ them and thus there's the problem of how to
translate the navtext property.

Right now I could think of two ways, both of which don't fully satisfy me:

1. Store a key in the navtext and in the template access a properties file.
That would require the user to maintain an additional file and keep it in
sync with the keys.

2. Directly store the translations in the navtext, i.e. like this: "en=Some
Folder,de=Irgendein Ordner,nl=Een map,es=Cualquier directorio,zh=某一个文件夹"
etc.
Then I'd have to split the navtext in the template and extract the correct
language. The problem with this is that it's quite fragile since the user
would need to enter the translations in the correct format, i.e. <language
code>=<translation>,<language code>=<translation>, ... . This might be error
prone.

Any more ideas?

Thanks in advance,

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20111014/751c1de8/attachment.htm>


More information about the opencms-dev mailing list