[opencms-dev] Problem with Default-Creation of english content on Multi-Language site

Achim Westermann achim.westermann at gmx.de
Wed Jun 17 23:37:29 CEST 2009


Hi Eska,

wow, passing a request parameter or storing the language in the session 
is not a standard way in OpenCms to do localization. If you intend to do 
this you should consider to program and configure your custom locale 
handler (not recommended by me). Most often you just set the property 
locale on the folder according to the language. And then an add on would 
be to add a cookie that remembers the last selected language and 
redirects to the according language folder when the entry page is hit.
Why would the copy locale button not make sense? The fact that the only 
available node is copied to the one and only default locale node (by 
default it is english if the locale property is not set) is a self 
healing process. You have to set the locale property right to have the 
system select the proper node of the XML content.

Kind Regards,
Achim.

-------------------
Achim Westermann

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org

Eska wrote:
> Hi Achim,
> 
> locale property is not set, because in this system (which i am only
> upgrading),
> the selection of langauge to use for creating the HTML-creation is done 
> through passing a request-parameter or getting it from the session. I can
> try
> tomorrow, if setting the locale of a file changes that behaviour I get. But
> anyway,
> that should not be the correct way of the system handling entered content,
> because
> then the Copy-Button does not really make sense.
> 
> Thanks 
> 
> Eska
> 
> 
> Achim Westermann-2 wrote:
>> Hi Eska,
>>
>> did you set the property locale to "cn" on the chinese folder? Did you 
>> set the property locale-available  to "cn" on the chinese folder. I'm 
>> out of the office (and away from a testing environment) right now but I 
>> think this should prevent the mechanism of filling the default locale 
>> node in the XML content with your only language version you have.
>>
>> Kind Regards,
>> Achim.
>>
>> -------------------
>> Achim Westermann
>>
>> Alkacon Software GmbH  - The OpenCms Experts
>> http://www.alkacon.com - http://www.opencms.org
>>
>>
>> Eska wrote:
>>> Hi Guys,
>>>
>>> i am developing a multi-language site (English, German, Chinese) and I
>>> just
>>> encountered a strange thing with the content-editor in our OpenCms 7.0.5.
>>>
>>> I have an XML-Content whre i only want to have the Chinese Locale
>>> entered.
>>> German and English Locale should be left empty.
>>>
>>> After reopening such an XML-Content for Editing,  The English language is
>>> preselected
>>> and the Chinese Content has been copied into the englisch locale part of
>>> the
>>> XML.
>>> After Saving, now English and Chinese Content is present in the XML.
>>>
>>> Is that a Bug or a Feature? Can i somehow configure the Editing to not
>>> create a "Default"-Content?
>>>
>>> The thing is, I need the possibility to only have chinese content edited,
>>> because i want to determine
>>> through something like
>>>
>>>    CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cmsObj,
>>> uriFile);
>>>    List foundLocales = xmlContent.getLocales();
>>>    boolean hasChinese = xmlContent.hasLocale(new Locale("zh"));
>>>
>>> if to show a News-Article only on the chinese News-Overview or not.
>>>
>>> Thanks,
>>>
>>> Eska
>>
>>
>> _______________________________________________
>> 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
>>
>>




More information about the opencms-dev mailing list