Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Internationalization Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWULocale

Module:  Internationalization Module   Group:  Localization


Does Not Inherit

Local Index

Members

Header File

#include <rw/i18n/RWULocale.h> 

Description

An RWULocale identifies a specific language, country, and variant. Services in the Internationalization Module that are sensitive to the locale of the user accept an RWULocale to tailor the behavior of the service.

RWULocale does not directly map to RWLocale in the Essential Tools Module of SourcePro Code, to POSIX locale, or to std::locale. RWULocale stringently defines the language, country and variant codes, unlike the less clearly specified names allowed by these other representations. The locale name associated with an RWULocale is composed of an ISO-639 language code, an ISO-3166 country code, and a platform-specific variant, separated by underscores. The variant name may be compound, composed of more than one variant, joined by underbars. A locale name need not contain all of these components--for example, es, es_ES, es__TRADITIONAL and es_ES_TRADITIONAL are all valid locale names.

The ISO standards are owned by the International Organization for Standardization. You may purchase copies of ISO-639 or ISO-3166 via their web site:

http://www.iso.ch

However, as of this writing, the same lists are available without charge. For a list of possible ISO-639 language codes, by the official ISO maintainer, see:

http://lcweb.loc.gov/standards/iso639-2/iso639jac.html

For a list of possible country codes, by the official ISO maintainer, see:

http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html

Another good resource is Robin Cover's XML "Cover Pages":

http://xml.coverpages.org/iso639-en-20000425.html

http://xml.coverpages.org/country3166.html

RWULocale does not directly provide formatting services, as do the SourcePro and standard C++ locale classes. Instead, RWULocale is used to index into the rich set of services provided by the Internationalization Module. For example, an RWULocale instance may be used to retrieve locale-dependent data from an RWUResourceBundle, or to take language-specific conventions into account when collating strings using an RWUCollator.

Because an RWULocale provides nothing more than simple locale identification, no validity checking is performed when you specify an RWULocale or one of its parts. To check the valid locale names, use RWUAvailableLocaleList to construct an iterator that references the const list of locale names currently recognized by the Internationalization Module.

Related Classes

RWUAvailableLocaleList, RWUAvailableLocaleListIterator, RWUResourceBundle

Static Member Functions

static RWULocale
getDefault();
static void
setDefault(const RWULocale& newDefault);

Public Constructors

RWULocale();

NOTE -- Do not use an empty locale to key into locale-specific behavior.
RWULocale(const RWCString& fullName);

NOTE -- Passing an empty string does not create an empty RWULocale, but instead creates a copy of the current default RWULocale. See also getDefault() and setDefault().
RWULocale(const char* fullName);

NOTE -- Passing an empty string or null pointer does not create an empty RWULocale, but instead creates a copy of the current default RWULocale. See also getDefault() and setDefault().
RWULocale(const char* language, const char* country,
          const char*  variant=0);

Public Member Operators

RWULocale&
operator=(const RWULocale& other);
bool
operator==(const RWULocale& other) const;
bool
operator!=(const RWULocale& other) const;

Public Member Functions

RWCString
getCountry() const;
RWUString
getDisplayCountry(const RWULocale& inLocale = 
                  RWULocale::getDefault()) const;
RWUString
getDisplayLanguage(const RWULocale& inLocale = 
                  RWULocale::getDefault()) const;
RWUString
getDisplayName(const RWULocale& inLocale = 
                  RWULocale::getDefault()) const;
RWUString
getDisplayVariant(const RWULocale& inLocale = 
                  RWULocale::getDefault()) const;
const RWCString
getIso3Country() const;
const RWCString
getIso3Language() const;
RWCString
getLanguage() const;
uint32_t
getLCID() const;
RWCString
getName() const; 
RWCString
getVariant() const;
uint32_t
hash() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.