Resource Bundles

Resource bundles are used for internationalization, including Cmobilecom AF, module and assembly resource bundles. Bundle base names: These resource bundles will be federated into one for each supported locale. Resource bundles are used in displaying messages, exceptions, entity type names, property names, menu node names, command names, select items, window/dialog/bean titles, form designs, role/permission names, etc. Expression #{bundle.Key} can be used in form designs.

Resource bundles must be in classpath to be accessible, either packaged inside a jar under WEB-INF/lib or put under WEB-INF/classes. Module resource bundles should be put inside module jar for easy deployment. see ExampleHR module.

Supported Locales

Supported locales are specified in [cmobilecom.home]/conf/system-config.xml. For example,

	<property name="supported.locales" value="en,zh_CN"/>
see System Configuration for detail.

Module Resource Bundle

The message bundle for default locale(fallback) is in English. For other locales, add messages_[locale].properties. For example,
The messages properties include I18N translations for entity types and their properties, commands and various messages. In addition, they also include I18N translations for permissions and roles if any. For example,
# Permissions
ExampleHR.ModuleAll=ExampleHR:All Permissions

ExampleHR.ManageEMP=Manage Employees
ExampleHR.ViewEMP=View Employees

# Roles
Role.HRManager=HR Manager
A permission belongs to a module and its name is prefixed with module name. But the scope of a role is instance, and it can be assigned permissions from different modules. When displaying a role, if its description is not set, then the message key Role.[roleName] of resource bundle will be used for display.

Assembly Resource Bundle

Module assembly resource bundles are under application root directory/resources/bundle:
Build script will change the bundle base name to assembly.bundle.messages, which will be in runtime classpath after application is deployed.