How To : Localizing and Internationalizing Applications
Page Status: Beta
Contents |
[edit] Description
Bungee provides no formal support for localization or internationalization. However, this document shows how this functionality can be simulated within your application using existing methods and APIs.
[edit] Prerequisites
Understanding Forms
DynamicForm control
FormList control
[edit] Procedure
- Create a parent class (for example, i18nClass) that contains a dummy instance of each resource (forms, strings, etc.) to be localized.
- Create a stub for each resource you wish to localize within the "i18nClass" class (for example, i18nClass.formAddress).
- Create a subclass for each localization you wish to support (for example, i18nClass_us, i18nClass_ca, etc).
- Within each localized subclass, override the resources that you wish to localize.
- Create a factory class with a single method (for example, i18nFactory.getClass).
- The prototype should return an instance of the parent localization class (for example, i18nClass).
- The factory method should return an instance of the subclass based on the user's specific localization.
- Using the factory class, retrieve an instance to the specific localization you wish to use.
- Reference this instance within a dynamic form (or dynamic form list) to correctly show the localized version.
[edit] Error Handling
[edit] Examples
[edit] Next Steps
[edit] Tags