Localizing TParameterFormatter instances

This class allows programmers to create messages that can be easily localized. To localize a preexisting TParameterFormatter:

  1. Translate the text string into the native language.
  2. Change the order of the variable elements within the string as necessary.
  3. For each variable element, attach a formatter that is appropriate for both the type of data and for the locale.
To change the text template, create a new text instance containing the localized text string and use the TParameterFormatter::SetTemplate member function to reset the template to this text. The parameters can be reorganized into any order within the text, although you still have to access them by the original index values.

Call the TParameterFormatter::SetParameterFormat member function for each parameter to set the new range of the parameter within the changed text template and to attach a localized formatter. The new formatter must accept the same type of formattable data. You might, for example, attach a TDateTimeFormatter for the Western European date format to a parameter that previously used a TDateTimeFormatter for the United States date format.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker