Localization in a process application has three layers; BPM / BAW gives you tooling for two of them:
- Coach labels, messages, portal texts - Localization resources (resource bundles in the library: key = value per locale). In a coach, a control's label can reference a bundle key (picked from the resource bundle chooser); in scripts tw.resource.<bundle>.<key> resolves in the user's locale on the server; coach views receive localized option values when the option is bound to a resource key.
- Data formats - dates, numbers, currencies follow the user's locale automatically in the UI Toolkit controls (Date Picker, Decimal with currency option); the user's locale comes from the browser or the portal preference (the user's locale from the portal preferences).
- Business content - product names, e-mail templates, document texts: keep them in EPVs or a database table keyed by locale; e-mail templates as HTML files (managed assets) per language selected with the user's preferred language.
// resource bundle "Labels" with keys orderNumber (en: "Order number", fr: "Numéro de commande")
// coach: Text control label = tw.resource.Labels.orderNumber (picked from the resource bundle chooser)
// server script:
var subject = tw.resource.Labels.emailSubjectApproved + " " + tw.local.order.number;
// client-side / custom coach view: bind a configuration option to the resource key, read it:
var label = this.context.options.label.get("value"); // already localized by the frameworkPractical rules: one bundle per toolkit / domain with a stable key naming (label.orderNumber, msg.creditExceeded); English as the default locale in the bundle so that missing translations fall back; translate through the bundle export / import (the resource bundle is edited per locale in the designer); test with a user whose portal locale is French - both the coach and the server texts must switch. Process Portal / Workplace UI themselves are localized by IBM (the user's preference selects the language).
References