11. Understanding internationalization Flashcards
1
Q
With Struts, how can you make a resource bundle for different languages?
A
PageName_en.properties
Next to your page, put a properties file that’s named PageName_locale.
within the file place ‘property=value’
2
Q
What tag do you use to display text from your resource bundle?
A
text name=”propertyValue”
3
Q
How can you pull bundle text with OGNL?
A
Use the getText(‘property.name’) method.
4
Q
How can you provide text from a bundle in a validator message (web.xml), rather than a string literal?
A
Use the key attribute for the message.
5
Q
How can you parameterize your localization text?
A
property.value=Hello {0}
Then when putting it on the page you just pass a param, the first one will replace the {0}