The ability to substitute variable substrings into the strings retrieved from message catalogs adds a level of flexibility to the localizable-text package, but this capability is of limited use unless the variable value can be localized. You can localize this value by nesting LocalizableTextFormatter instances.
successfulTransaction = The {0} operation on account {1} was successful. depositOpString = deposit withdrawOpString = withdrawal
public void updateAccount(String transactionType) { ... // Successful deposit LocalizableTextFormatter opLTF = new LocalizableTextFormatter("BankingResources", "depositOpString", "BankingSample"); Object[] args = {opLTF, new String(this.accountNumber)}; ... LocalizableTextFormatter successLTF = new LocalizableTextFormatter ("BankingResources", "successfulTransaction", "BankingSample", args); ... successLTF.format(this.applicationLocale); ... }
In this information ...Related concepts
Related tasks
Related reference
| IBM Redbooks, demos, education, and more |