Grails

Use of single quotes in i18n messages file prevents from args beeing resolved

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not A Bug
  • Affects Version/s: 1.0-RC3
  • Fix Version/s: 1.2 final
  • Component/s: Documentation
  • Labels:
    None

Description

When entering single quotes in a messages code line the following parameters (e.g. {1}) are not resolved, but the text is displayed.

Example:

messages.properties:

test.test1=Hello {0}, how is it as a {1}
test.test2=Hello {0}, how isn't it as a {1}

test.gsp:
<g:message code="test.test1" args="['Graeme', 'Grails-Coder']" /><br />
<g:message code="test.test2" args="['Graeme', 'Grails-Coder']" />


HTML Page:
Hello Graeme, how is it as a Grails-Coder
Hello Graeme, how isnt it as a {1}

If this is normal behavior, than it should be at least mentioned in the guide. It took me a while to find the problem....

Activity

Hide
Peter Ledbrook added a comment -

This is standard behaviour for Java resource bundles. You need to escape the quotes:

test.test2=Hello {0}, how isn''t it as a {1}
Show
Peter Ledbrook added a comment - This is standard behaviour for Java resource bundles. You need to escape the quotes:
test.test2=Hello {0}, how isn''t it as a {1}
Hide
Graeme Rocher added a comment -

Assigning all documentation related issues to 1.2 final since they don't represent a change to the codebase

Show
Graeme Rocher added a comment - Assigning all documentation related issues to 1.2 final since they don't represent a change to the codebase

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: