From adffaces-issues-return-1646-apmail-incubator-adffaces-issues-archive=incubator.apache.org@incubator.apache.org Mon Jan 08 19:05:50 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-issues-archive@locus.apache.org Received: (qmail 4142 invoked from network); 8 Jan 2007 19:05:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2007 19:05:49 -0000 Received: (qmail 54108 invoked by uid 500); 8 Jan 2007 19:05:56 -0000 Delivered-To: apmail-incubator-adffaces-issues-archive@incubator.apache.org Received: (qmail 54081 invoked by uid 500); 8 Jan 2007 19:05:56 -0000 Mailing-List: contact adffaces-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-issues@incubator.apache.org Delivered-To: mailing list adffaces-issues@incubator.apache.org Received: (qmail 54053 invoked by uid 99); 8 Jan 2007 19:05:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 11:05:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 11:05:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E4A1A71429F for ; Mon, 8 Jan 2007 11:05:27 -0800 (PST) Message-ID: <1320626.1168283127933.JavaMail.jira@brutus> Date: Mon, 8 Jan 2007 11:05:27 -0800 (PST) From: "Adam Winer (JIRA)" To: adffaces-issues@incubator.apache.org Subject: [jira] Created: (ADFFACES-347) TranslationsResourceLoader Get Wrong Resourcebundle For Locales Who Have Country Code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org TranslationsResourceLoader Get Wrong Resourcebundle For Locales Who Have Country Code ------------------------------------------------------------------------------------- Key: ADFFACES-347 URL: https://issues.apache.org/jira/browse/ADFFACES-347 Project: MyFaces ADF-Faces Issue Type: Bug Reporter: Adam Winer From an internal Oracle filer: org.apache.myfaces.trinidadinternal.resource.TranslationsResourceLoader.java, the locale is get using the following mechanism: . protected String getLocaleString(FacesContext context) { Object localeObj = context.getExternalContext().getRequestParameterMap(). get("loc"); return (localeObj == null || "".equals(localeObj)) ? null : localeObj.toString(); } which returns a string with language code and country code separated by a underscore, e.g. zh_cn . then it tries to get a Locale object using the following code: . Locale locale = LocaleUtils.getLocaleForIANAString(localeStr); . while, LocaleUtils.getLocaleForIANAString(String localeStr) can handle only locale strings which use a dash as the separator for language code and country code, since the parameter passed into this method is separated by a underscore, so the parameter is treated as a whole representing language code. then a wrong locale object is returned, i.e. new Locale("zh_CN","") is returned instead of new Locale("zh","CN"). finally, the system cannot find a resource bundle file whose language code is zh_CN, so it return the resource bundle file suffixed by the defult locale of the platform. . -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira