You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Pavitra Subramaniam (JIRA)" <de...@myfaces.apache.org> on 2011/09/13 20:01:11 UTC

[jira] [Issue Comment Edited] (TRINIDAD-2116) ResourceBundles Strings containing doubled single quotes are not properly formatted by FastMessageFormat on display...

    [ https://issues.apache.org/jira/browse/TRINIDAD-2116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101425#comment-13101425 ] 

Pavitra Subramaniam edited comment on TRINIDAD-2116 at 9/13/11 6:00 PM:
------------------------------------------------------------------------

Precisely. After a fair bit of testing by the i18n team we realized that the fix would not be backwards compatible. Unless all strings system-wide, are translated using the same WPTG rules we could easily break cases where doubled quotes need to be retained.
There are customers that currently have their bundle strings not just in these resource files, but in other places like database tables, libraries etc.. Changing the behavior of the formatting as proposed by the fix could break code that relies on retaining the doubled quotes. 
When re-visting this in the future we need a solution, that would not only maintain backward compatibility but also allow us move away from the fast message formatting altogether. 



      was (Author: pasubra):
    Precisely. After a fair bit of testing by the i18n team we realized that the fix would not be backwards compatible. Unless all strings system-wide, are translated using the same WPTG rules we could easily break cases where doubled quotes need to be retained.

There are teams that currently have their bundle strings in files, ADF libraries from other teams and in database tables. Changing the behavior of the formatting would break backward compatibility. (According to Andrew) who did the work to see if we could fix af:format and found that we could not. We could not even fix the problem with a web.xml setting as that would affect ADF libraries as well. The only fix that was accepted was to create new EL functions so the existing functions could continue to work untouched.

At this time we need a solution, that would maintain backward compatibility but allow us to start moving away from the fast message formatting altogether. 


  
> ResourceBundles Strings containing doubled single quotes are not properly formatted by FastMessageFormat on display... 
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2116
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2116
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.12-core
>            Reporter: Pavitra Subramaniam
>            Assignee: Jeanne Waldman
>             Fix For: 2.0.1
>
>         Attachments: jira-2116-1.2.12.6.0.patch, jira2116-trunk.patch
>
>
> The translations tool used by the WPTG team that provides translations for the Strings in the ResourceBundle uses special processing for single quotation marks, common in languages such as French. In ResourceBundle files, if a message contains an argument placeholder, e.g. {0} or {1}, it is assumed to be a format pattern for MessageFormat and the translation tool automatically doubles all single quotes inside such a message. If the message contains no arguments, it is expected to be used directly after loading from the bundle, without processing with MessageFormat. Therefore, no quotes are doubled automatically in such a message. This code change accounts for the presence of doubled quotes.
> Now FastMessageFormat.java and its counterpart on the client TrFastMessageFormatUtils object (Locale.js) assumes simple formatting rules and does not account for the presence of doubled single quotes. So this means that for some messages French users continue to see doubled quotes when single quotes are more the norm, For e.g., instead of 
> Entrez une date avec le même format que l'exemple suivant : 01/02/2011
> they see something like 
> Entrez une date avec le même format que l''exemple suivant : 01/02/2011
> (Notice the doubled quotes in l''exemple)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira