[opencms-dev] Bug if locales of the form "lc_CC" is used

Carsten Wilhelm wilhelm at bplusd.de
Wed Apr 4 12:19:34 CEST 2012


Hi,

Just found a potentially bug in 8.0.3.

We've changed to the locale "de_DE", which is displayed correctly in the XML-Content-Editors Dropdowns in the Explorer view. All content is displayed correctly on the website and can be edited using ADE normally.

Adding existing content using the "New" wizard, checking the content type and drag the existing element to the page is working, too.

Creating new content by dragging the content type to the webpage results in an error message: "Language de_DE already exists in xml document" (I get the german error message, so the english one might vary a little bit).
Debugging using Eclipse and source distribution leads to this line in CmsContainerpageService.java:

                Locale locale = new Locale(localeName);

Which fails if a locale containing a "_" is used. Unfortunately the java.util.Locale Class doesn't look after Underscores and puts "de_DE" in the language name. Afterwards, this seems to lead to confusion within the OpenCms. If I add a breakpoint here and change the value manually in Eclipse to "new Locale("de", "DE")" I can add the contant and from there on content addition is working for every other page. After restarting Tomcat I get the error again if I add new content.

So - should the new Locale() part be exchanged to something similar to what the CmsLocaleManager is doing? Or am I doing something completely wrong?

Kind regards,
Carsten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120404/1f3b2a8a/attachment.htm>


More information about the opencms-dev mailing list