fix: localised language display name in item info

- Inconstiency within Turkish translation file
This commit is contained in:
alexsparkes
2024-05-21 10:07:12 +01:00
parent 3da172ce9b
commit 5235958002
2 changed files with 4 additions and 2 deletions

View File

@@ -128,7 +128,9 @@ class Item extends PureComponent {
);
const locale = localStorage.getItem('language');
let languageNames = new Intl.DisplayNames(["en"], { type: "language" });
console.log(locale);
const shortLocale = locale.includes('_') ? locale.split('_')[0] : locale;
let languageNames = new Intl.DisplayNames([shortLocale], { type: "language" });
return (
<div id="item">