Before you begin
Identify strings that need to be localized.Why and when to perform this task
The localized-text package supports the substitution of variable substrings into a localized string that is retrieved from the message catalog by key.Steps for this task
Example
successfulTransaction = The operation on account {0} was successful.
The same key in message catalogs for other languages has a translation of this string with the variable at the appropriate location for each language.
public void updateAccount(String transactionType) { ... Object[] arg = {new String(this.accountNumber)}; ... LocalizableTextFormatter successLTF = new LocalizableTextFormatter ("BankingResources", "successfulTransaction", "BankingSample", arg); ... successLTF.format(this.applicationLocale); ... }
Related tasks
Setting optional localization values
Related reference
LocalizableTextFormatter class