When it comes to an image however, there is a simpler way to do that.
You will not need to add any code to the page class at all if you write the image tag
like this:

Run the application, and you should see the flag displayed like this:
This however, is not enough, as changing locale doesn't change a flag. When the
current locale is German, we want an English flag to be displayed in assistance to
those users who might want to switch the language back to English. To enable this,
all you have to do is to place an appropriate flag image into the assets directory
and name it flag_de.gif (again, you will find such an image in the source code for
the chapter). Do this, and whenever you will have current locale set to German, the
English flag will be displayed on the page:
Internationalization and Localization
[ 188 ]
As you see, most of what we have to do to internationalize a web application is to
provide the appropriate resources in different languages, and then to write a tiny bit
of code to make those resources available to the application, and to be able to change
the current locale. All the low-level work of obtaining and using the correct resources
is done for us by Tapestry.
Pages:
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240