Region

$(ANCHOR _Region) Provides information about a region. Remarks: Region does not represent user preferences. It does not depend on the user's language or culture.

Constructors

this
this(int cultureID)

Initializes a new Region instance based on the region associated with the specified culture identifier.

this
this(const(char)[] name)

$(ANCHOR Region_ctor_name) Initializes a new Region instance based on the region specified by name.

this
this(const(CultureData)* cultureData)
Undocumented in source.

Members

Functions

toString
immutable(char)[] toString()

Returns a string containing the ISO 3166 code, or the name, of the current Region.

Properties

currencyEnglishName
const(char)[] currencyEnglishName [@property getter]

Property. Retrieves the name in English of the currency used in the region.

currencyNativeName
const(char)[] currencyNativeName [@property getter]

Property. Retrieves the name in the native language of the region of the currency used in the region.

currencySymbol
const(char)[] currencySymbol [@property getter]

Property. Retrieves the currency symbol of the region.

current
Region current [@property getter]

Property. Retrieves the Region used by the current Culture.

englishName
const(char)[] englishName [@property getter]

Property. Retrieves the full name of the region in English.

geoID
int geoID [@property getter]

Property. Retrieves a unique identifier for the geographical location of the region.

isMetric
bool isMetric [@property getter]

Property. Retrieves a value indicating whether the region uses the metric system for measurements.

isoCurrencySymbol
const(char)[] isoCurrencySymbol [@property getter]

Property. Retrieves the three-character currency symbol of the region.

name
const(char)[] name [@property getter]

$(ANCHOR Region_name) Property. Retrieves the ISO 3166 code, or the name, of the current Region.

nativeName
const(char)[] nativeName [@property getter]

Property. Retrieves the full name of the region in its native language.

threeLetterRegionName
const(char)[] threeLetterRegionName [@property getter]

Property. Retrieves the three-letter ISO 3166 code of the region.

twoLetterRegionName
const(char)[] twoLetterRegionName [@property getter]

Property. Retrieves the two-letter ISO 3166 code of the region.

Examples

The following example displays some of the properties of the Region class:

import tango.io.Print, tango.text.locale.Common;

void main() {
  Region region = new Region("en-GB");
  Println("name:              %s", region.name);
  Println("englishName:       %s", region.englishName);
  Println("isMetric:          %s", region.isMetric);
  Println("currencySymbol:    %s", region.currencySymbol);
  Println("isoCurrencySymbol: %s", region.isoCurrencySymbol);
}

// Produces the following output.
// name:              en-GB
// englishName:       United Kingdom
// isMetric:          true
// currencySymbol:    £
// isoCurrencySymbol: GBP

Meta