<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I found a correct working solution in CmsLocaleManager.getLocale(locale), which checks for underscores and calls the Java Locale constructor accordingly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Can anybody confirm this? Maybe I will patch the 8.0.3 code and try this out in our installation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Kind regads,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Carsten</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F;mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE"> opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org]
<b>Im Auftrag von </b>Carsten Wilhelm<br>
<b>Gesendet:</b> Mittwoch, 4. April 2012 12:20<br>
<b>An:</b> opencms-dev@opencms.org<br>
<b>Betreff:</b> [opencms-dev] Bug if locales of the form "lc_CC" is used<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Just found a potentially bug in 8.0.3.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Adding existing content using the „New“ wizard, checking the content type and drag the existing element to the page is working, too.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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).<o:p></o:p></p>
<p class="MsoNormal">Debugging using Eclipse and source distribution leads to this line in CmsContainerpageService.java:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> Locale locale = new Locale(localeName);<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So - should the new Locale() part be exchanged to something similar to what the CmsLocaleManager is doing? Or am I doing something completely wrong?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal">Carsten<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F;mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>