Added language names
This commit is contained in:
@@ -6,10 +6,18 @@ fetch(url)
|
|||||||
.then((out) => {
|
.then((out) => {
|
||||||
const langInfo = out.lang_data;
|
const langInfo = out.lang_data;
|
||||||
|
|
||||||
|
const langNames = new Map([
|
||||||
|
["eo", "Esperanto"],
|
||||||
|
["en", "Englisch"],
|
||||||
|
["ru", "Russisch"],
|
||||||
|
["ja", "Japanisch"],
|
||||||
|
["es", "Spanisch"]
|
||||||
|
]);
|
||||||
|
|
||||||
let langInfoPrepped = [];
|
let langInfoPrepped = [];
|
||||||
Object.entries(langInfo).forEach((el) => {
|
Object.entries(langInfo).forEach((el) => {
|
||||||
let item = {};
|
let item = {};
|
||||||
item["name"] = el[1].learningLanguage;
|
item["name"] = langNames.get(el[1].learningLanguage);
|
||||||
item["count"] = el[1].xp;
|
item["count"] = el[1].xp;
|
||||||
|
|
||||||
// Filter irrelevant items
|
// Filter irrelevant items
|
||||||
|
|||||||
Reference in New Issue
Block a user