LocaleResolution

Interface

Locale signals of a read that carried a locale (the locale option or the client's locale). When a translation is missing, the API serves the closest one, such as the base language (fr for fr-CA) or the site default, instead of answering 404. These fields tell you which locale was served. Pass fallback: false to get a 404 on a detail read, or to drop the items from a list, instead. A read without a locale may omit these fields.

Property

Type

Optional

Description

isFallback

boolean

Yes

true when the record is served in another locale because requestedLocale has no translation.<br>Absent when the request carried no locale. Never true with fallback: false.

locale

string

Yes

BCP 47 locale code of the record actually served (e.g. 'en', 'fr').<br>Equals requestedLocale unless isFallback is true.

requestedLocale

string

Yes

BCP 47 locale code the request asked for (e.g. 'de'), as sent in the<br>locale request option or the client's configured locale.<br>Absent when the request carried no locale.