Set optional localization values
In addition to setting localization values that are required by LocalizableTextFormatter, you can set a number of optional values in the application code, either through the constructor or by calling any of several methods for that purpose. With optional values, you can do the following:
- Compose complex strings from variable substrings
- Customize the formatting of strings, taking into account variables other than time zone and locale
Perform the following steps to set up optional localization values:
In the application code, add the optional values into an array of type Object.
Object[] arg = {new String(getAccountNumber())};Pass the array into a LocalizableTextFormatter instance.
You can pass the array through the appropriate constructor or by calling the setArguments(Object[]) method (see Compose complex strings for an example).
Note: Because the array is passed by value rather than by reference, any updates to the array variable after this point are not reflected in the LocalizableTextFormatter instance unless it is reset by calling the setArguments(Object[]) method.
Next step: Generate localized text