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

Andera Del Bene commented on WICKET-3837:
-----------------------------------------

Actually is not a Wicket issue but is the standard behavior of  
java.text.MessageFormat class. Single quote is a special character and is 
removed from final string.
I've googled a little around but it seems that there's no easy solution. 

Two possible solutions are:
-use ` character instead of ' 
-write a custom MessageFormat and use it in Wicket.

> StringResourceModel doesn't handle correctly resources containing a single 
> quote
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-3837
>                 URL: https://issues.apache.org/jira/browse/WICKET-3837
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.4.17, 1.5-RC5.1
>            Reporter: Frédéric Donckels
>            Priority: Minor
>              Labels: localization
>         Attachments: WICKET-3837.patch
>
>
> When you have property values like these ones:
> Let's play!
> Let's play under the {0}
> The value is not handled properly and the final string values of the resource 
> model become:
> Lets play!
> Lets play in the {0}
> Whereas the same resource, when used in a wicket:message tag or loaded 
> through component.getResource(..) gets replaced correctly.
> [the first one is really relevant for wicket:message tags]
> I can have the proper behaviour if I double the quote (because of the 
> internal call to MessageFormat), but in that case, the 2 quotes show when the 
> wicket:message tag is used for that resource.
> This is problematic for multiple reasons:
> - the behaviour is not consistent
> - I can't reuse the same resource in different situations
> - I'd have to keep a registry of when a translated resource is used with a 
> StringResourceModel and when it's used 'normally' and would have to make the 
> company which translates our applications of the situation so that they could 
> double the quotes when appropriate. This is unmanageable.

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


Reply via email to