Skip to content

API / geotoolkit / util / Locale / Locale

Class: Locale

util.Locale.Locale

Defines locale class, which contains information for formatting numbers, dates and time.<br> The setDefault() function explained below, sets up your locale and then it will use it by default for all formatters.<br> To create a custom format or change format without specifying 'local' of a country you can use DecimalFormat

Table of contents

Constructors
  • [new Locale(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.locale.locale.md#new locale(options))
Methods
Css Properties
Name Type Description
localestringThe name of the locale
numberformatNumberFormatInfoDefines number format
numberformat-decstringDefines decimal symbol
numberformat-groupstringDefines group symbol
numberformat-infinitystringDefines infinity text
numberformat-negstringDefines negative symbol

Contents

Constructors

new Locale(options)

• new Locale(options?)

Parameters

Name Type
Optional optionsOptions
Methods

getClassName

▸ getClassName(): string

Returns

string


getLocaleName

▸ getLocaleName(): string

Return a name of the locale

Returns

string


getNumberFormatInfo

▸ getNumberFormatInfo(): NumberFormatInfo

Return number format

Returns

NumberFormatInfo

defines number format


getProperties

▸ getProperties(): Required<Options&gt;

Returns the properties pertaining to Locale

Returns

Required<Options&gt;

object containing locale properties


setProperties

▸ setProperties(options?): Locale

Sets the properties pertaining to Locale

Parameters

Name Type Description
Optional optionsOptionsobject containing locale properties

Returns

Locale


getClassName

▸ Static getClassName(): string

Returns

string


getDefault

▸ Static getDefault(): Locale

Return default locale

Returns

Locale

default locale


getLocale

▸ Static getLocale(locale): Locale

Parameters

Name Type Description
localestringcurrent locale

Returns

Locale


setDefault

▸ Static setDefault(locale): void

Sets default locale. Once user sets a default locale here it will be used by default for all formatters in all the plots.<br>

Please refer to the example below

Example

import {Locale} from '@int/geotoolkit/util/Locale';
Locale.setDefault(Locale.getLocale('ru'));

Parameters

Name Type Description
localeLocaledefault locale. It supports ['ae', 'au', 'ca', 'cn', 'eg', 'gb', 'hk', 'il', 'in', 'jp', 'sk', 'th', 'tw', 'us', 'at', 'br', 'de', 'dk', 'es', 'gr', 'it', 'nl', 'pt', 'tr', 'vn', 'bg', 'cz', 'fi', 'fr', 'no', 'pl', 'ru', 'se', 'ch']

Returns

void