Upgrade Considerations for Localization
The installer will take the following actions automatically:
- System default locale—Set to English (US).
- The Region block of User Preferences previously contained separate fields for country and language. That has been replaced by a Locale block containing a single drop-down list in which "English (United States)" is selected by default for all end users.
- Wizard list parameters that use comma delimited strings will still be supported for backward compatibility. But the new model for parameters of type list requires custom lookup tables, and all future editing of such parameters can only be done with custom lookup tables.
For localization to work properly, your database requires additional configuration beyond the basic requirements for TeamConnect. For details, see Database Requirements.
Localization Key Updates
See Localization Key Updates to see the updates in each version of TeamConnect.
Custom Blocks
Significant work is required to make custom blocks ready for localization. Custom blocks are defined by XML files which, in previous versions of TeamConnect, will contain literal text such as:
<br/>
* No E-Billing Role Available
<br/>
To localize such blocks, all occurrences of literal text must be converted to custom messages such as:
<br/>
<tc:message key="custom.CSM$.screen.xml.eBillingRoles.noEbillingRoleAvailable" />
<br/>
...where the referenced message key should have been already added via the Custom Messages facility in the object definition for CSM$. Such custom messages are visible in file custommessages.xml, after a design snapshot export, in the following format:
<CustomMessage
messageKey="custom.CSM$.screen.xml.eBillingRoles.noEbillingRoleAvailable" messageDefaultText="* No E-Billing Role Available"/>
Parameters
Text that used dynamic values will need to be rewritten to use the tc:messageParam tag. For example, a message that said:
Share documents to <tc:out value="${cjb.vendorName}" /> in Collaborati.
Becomes:
<tc:message key="custom.VEN$.screen.xml.vendorDocumentSharing.shareDocumentsToVendor">
<tc:messageParam value="${cjb.vendorName}"/>
</tc:message>
...and you create a corresponding custom message with key "custom.VEN$.screen.xml.vendorDocumentSharing.shareDocumentsToVendor" and text "Share documents to {0} in Collaborati."
Date Formatting
The example below shows date formatting and text localization. A custom message is supplied to the localize()
method.
public String getLastPublishedOnString() {
Date lastPublished = new Date();
String localizedDate =
platform.getUtilityService().formatDateByUserSetting(lastPublished);
return platform.getInternationalizationService().localize("customKey.publishedDateMess age", localizedDate);
}
Best Practices
Avoid using custom java code to simply append dynamic values in a message.
If the label of a field was previously hard-coded in a custom screen, use <tc:message>
instead of <tc:label>
to keep exactly the same text formatting.
Avoid making new custom messages for field labels if an existing label will do the job. For example, <tc:label label="Company Tax ID" />
could be replaced by the object definition field label <tc:label category="VEN$" name="companyTaxID" />
, presuming that the field label from the object definition already says "Company Tax ID". The label from the object definition will have been localized already, so this approach avoids double work.