Customizing Internationalization in VirtualViewer Java

Snowbound Software’s VirtualViewer Java includes the ability to configure the language that VirtualViewer displays. The default language for VirtualViewer is US English. VirtualViewer also supports German, French and Spanish. You can customize VirtualViewer to support other languages as well via a custom assets file.

To run VirtualViewer in one of the included languages besides US English, edit the applet tag in your applet.html file to add the following language parameter into your HTML code between <applet> the </applet>  and tags:

<param name="Language" value="French">

To run VirtualViewer in French, set the value of the Language parameter to French. To run VirtualViewer in German, set the value to German. To run VirtualViewer in Spanish, set the value to Spanish.

Specifying a Custom Assets File to Customize Languages

You can customize the VirtualViewer user interface text to be in any language you choose that uses the Unicode character set. You can also change the wording of the user visible text that is supplied with the product’s English, French, German and Spanish language support.

You use a custom assets file, customAssets.properties, to configure the user visible text that VirtualViewer displays. This file is specified in the applet tag in your applet.html file by the following parameter:

<param name="customAssetsFile" value="customAssets.properties">

The file specified must reside in the same location as the applet .jar file on your web server.

Since custom assets can be used to change the names of menus, dialog boxes, and so forth, it is easy to make those changes reflect another language entirely. Using dynamic pages, the custom asset file could be different, each one specifying element values in a different language, depending on location, group or whatever criteria is necessary.

Within VirtualViewerApplet.jar (or vvapplet), there are several files at com\snowbound\snapplet\applets\ that you can use as a starting point to add other languages. These include the following files:

  • File Name Description of file
  • I18N.properties Sample English language file
  • I18N_DE.properties Sample German language file
  • I18N_ES.properties Sample Spanish language file
  • I18N_FR.properties Sample French language file

You can extract the file that you want, rename it, modify it and then instead of having to re-bundle and re-sign the applet, you can reference the file externally. For example, you can extract I18N_FR.properties, rename it to FR.properties and place it at the same level as the applet.html file. Then in the html code, use the following parameter:

<param name="customAssetsFile" value="FR.properties">

Formatting the Custom Assets File to Customize Languages

The custom assets file should be in plain text format and it contains elements in the name=value format. The name portion of the custom asset is a fixed value, while the value portion can be changed and is reflected in the applet. For example:

menu-file.print=Print

status-search.close-button.img=images/toolbar/image/close-search.gif

image-panel.background.color=220,230,251

Assets with a .img suffix refer to an image whose path is relative to the applet jar file. Assets with a .color suffix refer to an RGB value specifying a color.

A full list of custom assets can be found in Appendix B – Custom Asset Tags in the VirtualViewer Java Client Administrator’s Guide. The latest versions are on-line here at: http://www.virtualviewer.com/VirtualViewerHelp/virtualviewer.htm#chconfi...

Category:

Online Demo