[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-dev
Subject:    [jira] Commented: (TRINIDAD-879) NLS: Translation to always honor
From:       "Jeanne Waldman (JIRA)" <dev () myfaces ! apache ! org>
Date:       2007-12-21 19:34:43
Message-ID: 3851593.1198265683166.JavaMail.jira () brutus
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/TRINIDAD-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554008 \
] 

Jeanne Waldman commented on TRINIDAD-879:
-----------------------------------------

 TRINIDAD-879  NLS: Translation to always honor view locale not formatting locale
The fix is to not use the locale that is in the LocaleElements*.js file name for the
translation strings for this file. Instead, send a request parameter to the server
with the translation locale.
- add a new method protected String getExtraParameters to LibraryScriptlet and \
                LocaleInfoScriptlet.java
- in LocaleInfoScriptlet.java, the getExtraParameters set "loc" to
arc.getLocaleContext().getTranslationLocale().toString();
- remove  protected String getLocaleString(FacesContext context) from \
TrTranslationsResourceLoader.java so that instead the superclass's method is called, \
which looks at the "loc" parameter for the locale to use when getting the message \
bundle.

committed to trunk.1.2.x
Completed: At revision: 606282  

committed to trunk
Completed: At revision: 606285  




> NLS: Translation to always honor view locale not formatting locale
> ------------------------------------------------------------------
> 
> Key: TRINIDAD-879
> URL: https://issues.apache.org/jira/browse/TRINIDAD-879
> Project: MyFaces Trinidad
> Issue Type: Bug
> Reporter: Jeanne Waldman
> Assignee: Jeanne Waldman
> 
> Trinidad embedded translations should always honor "view locale".
> Problem:
> 1. Usually Trinidad embedded translations are honoring "view
> locale"
> 2. However, when "formatting locale" is specified, translations will be
> following formatting locale instead.
> In theory, only localization definitions (such as date format
> pattern) should follow formatting locale.
> Here's a testcase.  The idea is:
> - we would like to have formatting support according to locale "Traditional
> Chinese-Hong Kong" (zh-HK).
> - However, language translations in Traditional Chinese (zh-TW) due
> to that fact that we do not provide zh-HK translations.
> facestring.jspx
> ===============
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad" >
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view locale="zh-TW">
> <tr:document title="InputText Demo">
> <tr:form>     
> <p>
> <tr:outputText value="view locale #{view.locale}"/>
> </p>
> <tr:inputText label="test" value="23245">
> <tr:convertDateTime dateStyle="short"/>
> </tr:inputText>
> <tr:commandButton text="Submit"/>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> faces-config.xml
> ================
> ...
> <supported-locale>zh-TW</supported-locale>
> <supported-locale>zh-HK</supported-locale>
> trinidad-config.xml
> ===================
> <?xml version="1.0" encoding="UTF-8"?>
> <trinidad-config xmlns="http:?/?/myfaces.apache.org?/trinidad?/config">
> 	
> <formatting-locale>zh-HK</formatting-locale>
> </trinidad-config>
> Problem:
> While formatting is presented in zh-HK, language translations are not shown
> in Traditional Chinese.
> Valid example: 98ChineseChar11ChineseChar29ChineseChar
> As a Reference Testcase:
> Remove formatting-locale in trinidad-config.xml  (i.e. only view locale =
> zh-tw below)
> Traditional Chinese translations present and shown correctly.
> ChineseChars "23245" ChineseChars. ChineseChars: "1998/11/29".
> While Trinidad supports more than 130 locales in terms of
> localization formatting (there are 132 files of
> META-INF/adf/jsLibs/resources/LocaleElements_*.js),
> - there are only 32 languages provided for translations (there are 33 files
> of oracle/adfinternal/view/faces/renderkit/rich/resource/RichBundle_*.class)
> A fallback approach will be often required for appropriate i18n support.  For
> example:
> locale formatting  language translations
> =================  =====================
> zh-HK              zh-TW
> zh-SG              zh-CN
> zh-MO              zh-TW
> etc.
> This bug and analysis was found by our NLS expert.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic