Skip to main content

Function: isMessageRefTranslated()

isMessageRefTranslated(__namedParameters): boolean

Defined in: createI18n.ts:338

Whether a reference renders entirely in intl.locale: every message it holds, nested references included, has an entry in intl.messages. In the source locale (intl.defaultLocale) every reference is translated, since its defaultMessage is already that language, and so is a plain string; in any other locale a plain string is untranslated source text.

render never says when it fell back, so this is how a caller records which locale it actually served — a stored rendering, a wrong-locale alert.

Parameters​

ParameterType
__namedParameters{ intl: Pick<IntlShape, "locale" | "defaultLocale" | "messages">; ref: string | MessageRef; }
__namedParameters.intlPick<IntlShape, "locale" | "defaultLocale" | "messages">
__namedParameters.refstring | MessageRef

Returns​

boolean