2023-03-07 15:38:06 +01:00
|
|
|
export default function localeCode2Text(code) {
|
2023-06-05 05:40:30 +02:00
|
|
|
try {
|
|
|
|
return new Intl.DisplayNames(navigator.languages, {
|
|
|
|
type: 'language',
|
|
|
|
}).of(code);
|
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
|
|
|
return null;
|
|
|
|
}
|
2023-03-07 15:38:06 +01:00
|
|
|
}
|