translation.Locale

Note:

JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value.

Enum Description

Holds the string values for supported locales for Translation Collections. Use this enum to set the locale argument to translation.get(options), translation.selectLocale(options), and translation.load(options).

This enum lists all locales that are enabled for a company. This enum also includes two special values: CURRENT and COMPANY_DEFAULT. The CURRENT value represents the current user’s locale, and the COMPANY_DEFAULT value represents the default locale for the company.

Type

enum

Supported Script Types

Client and server scripts

For additional information, see SuiteScript 2.x Script Types.

Module

N/translation Module

Sibling Object Members

N/translation Module Members

Since

2019.1

Values

The following table lists all possible locale values and the respective languages. Typically, only some of these locales will be enabled for a company and available to use with Translation Collections.

Locale

Language

CURRENT

Language currently set by the user

COMPANY_DEFAULT

Default company language

af_ZA

Afrikaans (South Africa)

ar

Arabic

bg_BG

Bulgarian (Bulgaria)

bn_BD

Bengali (Bangladesh)

bs_BA

Bosnian (Bosnia and Herzegovina)

cs_CZ

Czech (Czechia)

da_DK

Danish (Denmark)

de_DE

German (Germany)

el_GR

Greek (Greece)

en

English

en_AU

English (Australia)

en_CA

English (Canada)

en_GB

English (United Kingdom)

en_US

English (United States)

es_AR

Spanish (Argentina)

es_ES

Spanish (Spain)

et_EE

Estonian (Estonia)

fa_IR

Farsi (Iran)

fi_FI

Finnish (Finland)

fr_CA

French (Canada)

fr_FR

French (France)

gu_IN

Gujarati (India)

he_IL

Hebrew (Israel)

hi_IN

Hindi (India)

hr_HR

Croatian (Croatia)

hu_HU

Hungarian (Hungary)

hy_AM

Armenian (Armenia)

id_ID

Indonesian (Indonesia)

is_IS

Icelandic (Iceland)

it_IT

Italian (Italy)

ja_JP

Japanese (Japan)

kn_IN

Kannada (India)

ko_KR

Korean (Korea)

lb_LU

Luxembourgish (Luxembourg)

lt_LT

Lithuanian (Lithuania)

lv_LV

Latvian (Latvia)

mr_IN

Marathi (India)

ms_MY

Malay (Malaysia)

nl_NL

Dutch (Netherlands)

no_NO

Norwegian (Norway)

pa_IN

Punjabi (India)

pl_PL

Polish (Poland)

pt_BR

Portuguese (Brazil)

pt_PT

Portuguese (Portugal)

ro_RO

Romanian (Romania)

ru_RU

Russian (Russia)

sh_RS

Serbian (Latin)

sk_SK

Slovakian (Slovakia)

sl_SI

Slovenian (Slovenia)

sq_AL

Albanian (Albania)

sr_RS

Serbian (Serbia)

sv_SE

Swedish (Sweden)

ta_IN

Tamil (India)

te_IN

Telugu (India)

th_TH

Thai (Thailand)

tl_PH

Tagalog (Philippines)

tr_TR

Turkish (Türkiye)

uk_UA

Ukrainian (Ukraine)

vi_VN

Vietnamese (Viet Nam)

zh_CN

Chinese (Simplified)

zh_TW

Chinese (Traditional)

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/translation Module Script Samples.

             // Add additional code
...
let myMsg = message.create({
    title: translation.get({
        collection: 'custcollection_my_strings',
        key: 'MY_TITLE',
        locale: translation.Locale.COMPANY_DEFAULT
    })(),
    message: translation.get({
        collection: 'custcollection_my_strings',
        key: 'MY_MESSAGE',
        locale: translation.Locale.COMPANY_DEFAULT
    })(),
    type: message.Type.CONFIRMATION
});
...
// Add additional code 

          

Related Topics

N/translation Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices