@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
15 lines • 402 B
JavaScript
import { DEFAULT_LANG } from '../constants';
import { log } from './log';
export function getDisplayNames() {
var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_LANG;
try {
return new Intl.DisplayNames(lang, {
type: 'region'
});
} catch (error) {
log(error);
return new Intl.DisplayNames(DEFAULT_LANG, {
type: 'region'
});
}
}