[opencms-dev] Bug if locales of the form "lc_CC" is used
Tobias Herrmann
t.herrmann at alkacon.com
Tue Apr 10 15:51:12 CEST 2012
Hi Carsten,
I think you are right. There are many calls to 'new Locale(String)' that should be replaced with calling the static 'CmsLocaleManager.getLocale(String)' method. We will include that into the soon to be released version 8.0.4 of OpenCms.
Greetings, Tobias
--
Visit OpenCms Days 2012 Conference and Expo September 24 to 25, 2012 in Cologne, Germany http://www.opencms-days.org
Alkacon Software GmbH - The OpenCms Experts
http://www.alkacon.com -- http://www.opencms.org
Am 10.04.2012 11:31, schrieb Carsten Wilhelm:
>
> Hi,
>
> Sorry - has nobody a similar problem? I found a lot of calls to the constructor "new Locale(locale)" which is incorrect if you are using locales containing country and maybe variant.
>
> I found a correct working solution in CmsLocaleManager.getLocale(locale), which checks for underscores and calls the Java Locale constructor accordingly.
>
> From my point of view, all occurrences of the standard constructor (where user defined locales are used) need to be replaced by a call to the static method above.
>
> Can anybody confirm this? Maybe I will patch the 8.0.3 code and try this out in our installation.
>
> Kind regads,
>
> Carsten
>
> *Von:*opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] *Im Auftrag von *Carsten Wilhelm
> *Gesendet:* Mittwoch, 4. April 2012 12:20
> *An:* opencms-dev at opencms.org
> *Betreff:* [opencms-dev] Bug if locales of the form "lc_CC" is used
>
> 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
>
>
>
> _______________________________________________
> 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/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120410/4ef37099/attachment.htm>
More information about the opencms-dev
mailing list