Home Manual Reference Source Test Repository
import {Locale} from '@cedx/gulp-smartling/src/locale.js'
public class | source

Locale

Represents a locale, that is a language-region pair.

Test:

Constructor Summary

Public Constructor
public

constructor(locale: string)

Initializes a new instance of the class.

Member Summary

Public Members
public

The ISO 639-1 two-letter code for the language.

public

The ISO 3166 two-letter code for the country/region.

public get

Gets the default specific locale corresponding to this neutral locale.

Method Summary

Public Methods
public

Converts this object to a map in JSON format.

public

Returns a string representation of this object.

Public Constructors

public constructor(locale: string) source

Initializes a new instance of the class.

Params:

NameTypeAttributeDescription
locale string
  • optional

The code representing this locale.

Test:

Public Members

public language: string source

The ISO 639-1 two-letter code for the language.

public region: string source

The ISO 3166 two-letter code for the country/region.

public get specificLocale: Locale source

Gets the default specific locale corresponding to this neutral locale. Returns this locale if no specific locale matches or if it is already specific.

Test:

Public Methods

public toJSON(): object source

Converts this object to a map in JSON format.

Return:

object

The map in JSON format corresponding to this object.

Test:

public toString(): string source

Returns a string representation of this object.

Return:

string

The string representation of this object.

Test: