[opencms-dev] Locale

Bernd Wolfsegger bw at code-create.com
Tue Mar 15 07:27:22 CET 2005


For sure, there is only one dog, at least if you look at it from the right 
direction.

That works fine, o.k..
You don't even have to define a new property.
There is already this property "locale".
And in my case I do not even need a redirect, because for my site I want to 
have the English content for the .com Domain and the German content for 
the .de domain. So I simply have to virtual hosts and two entrys in the 
opencms-system.xml for both domains pointing to the correct folder.
One problem with this approach is, that if you add new content documents, you 
have to create siblings in each language folder for these new documents.
And that is prone to errors.

I need to have the complete structure of all files (siblings) and folders in 
each language folder.
This is because else the navigation would not show up.
And that is because of this path thing problem I mentioned in an earlier post.
(Seems nobody has a solution for that ...)
When I am calling the site from outside, the path is simply  "/", so the 
navigation code looks into the language folder, the "/" folder in this case, 
because I am in this folder. Calling from internal the path is 
"/sites/mysite/", so navigation will take the correct folder, undependent 
from where am I actually.

Perhaps this is no problem if you do a redirect.
But I can't do it per apache, because form data is lost with such a redirect.
Are you doing the redirect programatically?

Well, I wrote in my last post about this method getContent(...) :-)
But I would like to have the same thing for the equivalent contentload tag, or 
a possibility to set it per page in general, because I think it is seldom 
that you will have different language content in one page at the same time.

And the "staff of translators" is a point too ...

On Monday 14 March 2005 20:25, you wrote:
> There shall only be one (dog)
>
> The dog1.xml has ALL the data, in each language.
>
> Well, this approach is not perfect, because you could have a staff of
> translators, and only one of them could have locked the dog1.xml, so no
> paralell translation.
>
> But this is a nice content structure, you can have your content organized
> in the same tree and get the data in different languages using a link and a
> property.
>
> Remember that you can get the content data programatically using
>
> ----snip-----------------------------
> <jsp:useBean id="cmsbean" class="org.opencms.jsp.CmsJspActionElement">
>   <% cmsbean.init(pageContext, request, response); %>
> </jsp:useBean>
>
> <%
> 	// getting english content
> 	String content = cmsbean.getContent("path_to_xml", "property_name",
> java.util.Locale.ENGLISH);
> %>
> ----snip-----------------------------



More information about the opencms-dev mailing list