10 lines
214 B
JavaScript
10 lines
214 B
JavaScript
export default function localeCode2Text(code) {
|
|
try {
|
|
return new Intl.DisplayNames(navigator.languages, {
|
|
type: 'language',
|
|
}).of(code);
|
|
} catch (e) {
|
|
console.error(e);
|
|
return null;
|
|
}
|
|
}
|