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’
![](https://s3.amazonaws.com/brainscape-prod/system/cm/343/659/505/a_image_thumb.png?1619105222)
2
Q
What tag do you use to display text from your resource bundle?
A
text name=”propertyValue”
![](https://s3.amazonaws.com/brainscape-prod/system/cm/343/660/659/a_image_thumb.png?1619105281)
3
Q
How can you pull bundle text with OGNL?
A
Use the getText(‘property.name’) method.
![](https://s3.amazonaws.com/brainscape-prod/system/cm/343/660/739/a_image_thumb.png?1619105364)
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.
![](https://s3.amazonaws.com/brainscape-prod/system/cm/343/660/803/a_image_thumb.png?1619105630)
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}
![](https://s3.amazonaws.com/brainscape-prod/system/cm/343/661/262/a_image_thumb.png?1619105781)