[JIRA] Created: (CAL-13) Single quote causes bad parsing

Single quote causes bad parsing ------------------------------- Key: CAL-13 URL: http://jira.qos.ch/browse/CAL-13 Project: CAL10N Issue Type: Bug Reporter: Gilles Assignee: Ceki Gulcu When in a "properties" file containing the localized message patterns, there is a single quote in a pattern, it doesn't appear in the output and prevents the conversion of the curly-braced variables that follow it. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/CAL-13?page=com.atlassian.jira.plugin.system.issue... ] Ceki Gulcu commented on CAL-13: ------------------------------- For additional details see http://www.qos.ch/pipermail/cal10n-user/2010-March/000016.html
Single quote causes bad parsing -------------------------------
Key: CAL-13 URL: http://jira.qos.ch/browse/CAL-13 Project: CAL10N Issue Type: Bug Reporter: Gilles Assignee: Ceki Gulcu
When in a "properties" file containing the localized message patterns, there is a single quote in a pattern, it doesn't appear in the output and prevents the conversion of the curly-braced variables that follow it.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/CAL-13?page=com.atlassian.jira.plugin.system.issue... ] Gilles commented on CAL-13: --------------------------- I've found the origin of the problem: "java.text.MessageFormat" disallows single quotes (as they are used to quote an opening curly bracket). To output a single quote, one must represent it as two successive single quotes in the pattern string. The CAL10N documentation could warn about this "problem" (that will make the localization data files will be a bit ugly), although it does it already, indirectly: ---CUT--- The default IMessageConveyor implementation, namely MessageConveyor, uses the standard Java convention for parameter substitution as defined by the java.text.MessageFormat class. ---CUT---
Single quote causes bad parsing -------------------------------
Key: CAL-13 URL: http://jira.qos.ch/browse/CAL-13 Project: CAL10N Issue Type: Bug Reporter: Gilles Assignee: Ceki Gulcu
When in a "properties" file containing the localized message patterns, there is a single quote in a pattern, it doesn't appear in the output and prevents the conversion of the curly-braced variables that follow it.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/CAL-13?page=com.atlassian.jira.plugin.system.issue... ] Gilles commented on CAL-13: --------------------------- Alternatively the parser code could check whether the single quote actually quotes a left curly bracket and, if not, append a second single quote. Hence one could use single quote normally (from the point of view of someone writing localized messages). And if a left bracket is needed in the output, the pattern string should be: <'{'> (without the enclosing angle brackets). This would depart from the "MessageFormat" convention and be somewhat asymmetric since to obtain {0} in the output, one would need a pattern such as '{'0} However this will happen much less often than the use of single quotes.
Single quote causes bad parsing -------------------------------
Key: CAL-13 URL: http://jira.qos.ch/browse/CAL-13 Project: CAL10N Issue Type: Bug Reporter: Gilles Assignee: Ceki Gulcu
When in a "properties" file containing the localized message patterns, there is a single quote in a pattern, it doesn't appear in the output and prevents the conversion of the curly-braced variables that follow it.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/CAL-13?page=com.atlassian.jira.plugin.system.issue... ] Ceki Gulcu resolved CAL-13. --------------------------- Resolution: Fixed As you suggested, the documentation has been updated. For details see http://github.com/ceki/cal10n/commit/b4e2fa77115a5a2af82
Single quote causes bad parsing -------------------------------
Key: CAL-13 URL: http://jira.qos.ch/browse/CAL-13 Project: CAL10N Issue Type: Bug Reporter: Gilles Assignee: Ceki Gulcu
When in a "properties" file containing the localized message patterns, there is a single quote in a pattern, it doesn't appear in the output and prevents the conversion of the curly-braced variables that follow it.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Gilles (JIRA)