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/html/i18n';
hasRegisteredLocale('fr'); // false until registered
registerI18n('fr', { Play: 'Lecture' });
hasRegisteredLocale('fr'); // true
import { hasRegisteredLocale, registerI18n } from '@videojs/react/i18n';
hasRegisteredLocale('fr'); // false until registered
registerI18n('fr', { Play: 'Lecture' });
hasRegisteredLocale('fr'); // true
API Reference
Parameters
| Parameter | Type | Default | Details |
|---|---|---|---|
locale*
|
string & object | 'hr' | 'th' | 'tr' ...
|
—
|
|
|
|||
Return Value
boolean