Перейти к содержимому

Locales

A locale is a BCP 47 tag that sets the language of text meant for people, such as the message in an error response, and changes nothing else.

A locale field in a request, such as the one in user settings, has to be one of these values exactly, with the same upper and lower case.

ValueDescription
arArabic
beBelarusian
bgBulgarian
bnBangla
caCatalan
csCzech
daDanish
deGerman
elGreek
en-GBEnglish (United Kingdom)
en-USEnglish (United States)
es-ESSpanish (Spain)
es-419Spanish (Latin America)
fiFinnish
filFilipino
frFrench
heHebrew
hiHindi
hrCroatian
huHungarian
idIndonesian
itItalian
jaJapanese
koKorean
ltLithuanian
lvLatvian
nlDutch
noNorwegian
plPolish
pt-BRPortuguese (Brazil)
pt-PTPortuguese (Portugal)
roRomanian
ruRussian
skSlovak
slSlovenian
sqAlbanian
sv-SESwedish
thThai
tokToki Pona
trTurkish
ukUkrainian
viVietnamese
zh-CNChinese (Simplified)
zh-TWChinese (Traditional)

When you’re signed in and your account has a saved locale, the API uses it.

Otherwise the API picks a locale from the Accept-Language header and uses en-US when the header is missing or nothing in it matches.

The API sorts the Accept-Language tags by q weight and makes two passes over them. Matching ignores case and takes _ for -.

  1. The first tag that is a supported locale wins. A few other tags count as one in this pass.
  2. If no tag matched, the first tag whose language subtag has a locale wins, so fr-CA picks fr. Some language subtags pick a set locale.
TagCounts as
enen-US
svsv-SE
tlfil
nbno
nnno

Two rules come first.

  • A zh tag with Hant, TW, HK or MO picks zh-TW, the traditional script.
  • A Portuguese tag with a region other than BR, such as pt-AO, picks pt-PT.

Other tags with these language subtags pick the locale the table gives.

Language subtagLocale
enen-US
eses-ES
ptpt-BR
zhzh-CN