Skip to content
FrameworkStyle

hasRegisteredLocale

Check whether an exact locale tag exists in the global i18n registry

hasRegisteredLocale returns whether a normalized locale tag has an explicit registry layer from registerI18n. It does not indicate whether a lazy built-in pack exists. Only registry entries count.

import { hasRegisteredLocale, registerI18n } from '@videojs/react/i18n';

hasRegisteredLocale('fr'); // false until registered
registerI18n('fr', { buttons: { play: 'Lecture' } });
hasRegisteredLocale('fr'); // true

API Reference

Parameters

ParameterTypeDefaultDetails
locale*string & object | 'ar' | 'az' | 'bs' ...

Return Value

boolean