For error messages during validation, each supported locale has a types_<locale>.properties and a typesext_<locale>.properties file (such as types_en.properties and typesext_en_US.properties). To provide National Language Support (NLS), the toolkit uses ErrorInfo's get(String id, Locale locale) method (which in turn uses the DSEType getMessageForLocale method) passing the key as the message ID and the locale stored in the dse_locale variable of the session as the locale. The getMessageForLocale method retrieves the localized message from the appropriate resource bundle. Note that the method first checks the typesext_<locale>.properties file before it checks the types_< locale>.properties file.
To see how NLS works with validation messages, look at the following:
To improve performance with localization, the Branch Transformation Toolkit features two caches of resource bundle instances: typesext and types. The toolkit implements the caches as a Hashtable in the resTypesCache attribute (for classes in the com.ibm.dse.base.types package) and the resTypesExtCache attribute (for classes in the com.ibm.dse.base.types.ext package) of DSEType classes. The key in each Hashtable is the locale object and the value is the resource bundle associated with the locale. When the system needs to get a localized message, it searches in the caches for the locale's resource bundle. The system first looks in the typesext cache. If the system cannot find the resource bundle in the typesext cache, it then look in the types cache. Note that you can extend typesext resource bundles with your own codes to override resource bundles contained in the types cache because typesext resource bundles have priority over types resource bundles.
If the resource bundle is not in either cache, the system gets it, retrieves the localized message, and places the resource bundle in the cache. If the system cannot find the locale's resource bundle, it places a flag in the appropriate cache. The flag means that the system does not look for this resource bundle and reduces the high performance cost associated with throwing exceptions.