@openmrs/esm-utils
Version:
Helper utilities for OpenMRS
15 lines (14 loc) • 436 B
text/typescript
/**
* Returns the current locale of the application.
* @returns string
*/
export function getLocale() {
let language = window.i18next.language;
language = language.replaceAll('_', '-'); // just in case
// Hack for `ht` until all browsers update their unicode support with ht to fr mapping.
// See https://unicode-org.atlassian.net/browse/CLDR-14956
if (language === 'ht') {
language = 'fr-HT';
}
return language;
}