![]() |
![]() ![]() ![]() |
You shouldn't use message-embedded images for icons, banners, and others,
instead, had better use no-message images with tooltip texts or labels.
Tooltip texts and labels are text data, so creating each language one
is easy (just translation),
but images needs some designing tools and takes much time for creating each language version.
About the media such as movies, voices, and others,
you have to create each language version of them, but shouldn't overwrite.
To create a function to switch the media files is good solution.
For switching the media, you need to create the naming or locating rule of media files with language and
country codes, and use some locale functions.
About locale, refer to each programming chapter.
The following is a simple example of switching the media files to each user language in JSP.
<% String mediaDirPath = "***"; String voiceDir = "voices"; String voiceFileName = "foo.wav"; String lang = request.getLocale().toString(); if (!new File(mediaDirPath + "/" + voiceDir + "/" + lang + "/" + voiceFileName) .exists()){ lang = "en"; } %> <a href="<%=voiceDir + "/" + lang + "/" + voiceFileName%>">My Voice!</a> * 'request.getLocale().toString()' returns 'en', 'ja', ... (language codes) * The media files (.wav) are located as follows. .../voices en/foo.wav ... English voice file (default) ja/foo.wav ... Japanese voice file ....
Go to Internationalization Programming Top