Class

Locale


Description

Used to represent a Locale, which describes linguistic, cultural and other Locale-specific information. For example, a Locale might specify “English as spoken in the United States, using the metric system”.

Properties

Name

Type

Read-Only

Shared

CurrencySymbol

String

Current

Locale

DecimalSeparator

String

GroupingSeparator

String

Identifier

String

Raw

Locale

Methods

Name

Parameters

Returns

Shared

Constructor

localeIdentifier As String

Property descriptions


Locale.CurrencySymbol

CurrencySymbol As String

The Locale’s currency symbol.

This property is read-only.

Get the Locale’s currency symbol:

Var USEnglishLocale As New Locale("en-US")

Var symbol As String
symbol = USEnglishLocale.CurrencySymbol

Locale.Current

Current As Locale

The user’s current Locale. For web apps, this is the Locale of the server. To get the Locale of the browser, use WebSession.

This property is read-only.

Get the current Locale:

Var currentLocale As Locale
currentLocale = currentLocale.Current

Locale.DecimalSeparator

DecimalSeparator As String

The Locale’s separator between the integer and decimal portions of a number. In “un-US”, this is the ‘period’.

This property is read-only.

Get the Locale’s decimal separator:

Var USEnglishLocale As New Locale("en-US")

Var decimal As String
decimal = USEnglishLocale.DecimalSeparator

Locale.GroupingSeparator

GroupingSeparator As String

The Locale’s separator for grouping a number. In “en-US”, this is the ‘comma’ placed between every three integer digits.

This property is read-only.

Get the Locale’s grouping separator:

Var USEnglishlLocale As New Locale("en-US")

Var grouping As String
grouping = USEnglishlLocale.GroupingSeparator

Locale.Identifier

Identifier As String

This is the Locale’s identifier. The identifier may not exactly match the identifier passed in via the constructor due to conversions (e.g. ‘en_US’ could become ‘en-US’).

This property is read-only.

Get the Locale’s identifier:

Var USEnglishLocale As New Locale("en-US")

Var id As String
id = USEnglishlLocale.Identifier

Locale.Raw

Raw As Locale

A machine-independent Locale that has a well-defined format (i.e. the POSIX Locale) and is not affected by the user’s settings.

This property is read-only.

Get the raw Locale:

Var currentLocale As Locale
currentLocale = currentLocale.Raw

Method descriptions


Locale.Constructor

Constructor(localeIdentifier As String)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a Locale with the given localeIdentifier.

As an example, “en-US” is used as a localeIdentifier for English in the United States.

Links to look up codes:

A RuntimeException is raised when an invalid localeIdentifier is used.

Create an English US Locale:

Var USEnglishLocale As New Locale("en-US")

Notes

For web apps, this returns the Locale of the app running on the server. To get the Locale of the connected user from the browser use WebSession.

For more information on localization, refer to the Localization topic .

Compatibility

All projects types on all supported operating systems.

See also

Object parent class; DateTime class