Iterating Through Available Locales

Use ILocaleKeyIterator to iterate through the available locales. ILocaleKeyIterator iterates through the locales currently installed on the system, not the complete set of supported locales.

To use ILocaleKeyIterator:

  1. Instantiate an ILocaleKeyIterator.
  2. Use operator++ or operator-- to move forward or backward through the list of installed locales.
  3. Use operator* to return a key for the locale currently referenced by the iterator or use operator-> to return a constant pointer to the key.

For example, this code shows how to iterate through the available locales, printing out the English name for each locale:

// Create the iterator

ILocaleKeyIterator iter;

// Create a key for an English locale

ILocaleKey english("EN");

while (iter) {

// Get the name of the current locale

	IText name = (*iter).displayName(english);

	cout << name << "/n";

	cout.flush();

// Increment the iterator to the next locale in the list

	iter++;

}


Overview of Locale Classes
Locale Names