Class I18nManagerMultiResource

java.lang.Object
org.web3d.util.I18nManagerMultiResource

public class I18nManagerMultiResource extends Object
Manager of all internationalisation in the toolkit.

This class acts as a singleton manager for internationalisation within j3d.org Code and all applications built on it. It may be used for any string resource that may require internationalisation - not just text on buttons but also error messages, log messages etc.

External Application Usage

An application should initialise this manager as soon as possible after startup - ideally before anything else happens. The initialization ensures that the right resources are loaded before people start making queries. The initialization process should provide an application name as a reference point for internationalisation preferences that are stored to preserve settings between runs of the application. In no application name is provided, then the preferences are not stored and it will need to be reset each time the application runs. The reason for the application name is that this manager is shared in a toolkit with many different potential end applications making use of it. The application names allows us to create separate sets of settings on a per-application basis rather than relying on global settings for the user's computer.

The second direct customisation point is to provide a base name for the resource bundle to be loaded. If no name is provided, it will load the resource bundle named config.i18n.j3dorgResources from the classpath. This class follows the normal naming conventions that are defined in ResourceBundle. Any application providing their own resource bundle must provide values for every chefx3d resource that is specified in the base file that comes with this toolkit. Failure to do so will result in blank areas on the user interface and most probably an unusable application.

If an application wishes to also internationalise other settings, such as numerical representations, then you can query this class for the Locale it actually loaded, rather than the one you requested (fairly typical issue).

Note:

Because this class just stores string values, it is entirely possible to use it to store non-text information as well for a more generic internationalisation system. For example, storing the names of icon files could be a valid use of this class, allowing localisation for more than just text, but also graphical resources.

Resource Bundle Property Naming Conventions

With a property file containing all the internationalisation of a probably very large application, naming conventions are a necessity. Properties that are internal to any j3d.org-specific user interface element will start with the package name, class name (case included) and finally the resource property name after that.
Version:
$Revision: 1.1 $
Author:
Justin Couch