From e0e3a386616cae3b63aa8e7a38444df0363f654b Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 17 Mar 2024 11:34:35 +0000 Subject: [PATCH 1/3] fix(i18n): update translations script --- scripts/updatetranslations.js | 125 ++++++++++++---------- src/i18n/locales/achievements/bn.json | 58 ++++++++-- src/i18n/locales/achievements/de_DE.json | 58 ++++++++-- src/i18n/locales/achievements/en_US.json | 58 ++++++++-- src/i18n/locales/achievements/es.json | 58 ++++++++-- src/i18n/locales/achievements/es_419.json | 58 ++++++++-- src/i18n/locales/achievements/fr.json | 58 ++++++++-- src/i18n/locales/achievements/id_ID.json | 58 ++++++++-- src/i18n/locales/achievements/nl.json | 58 ++++++++-- src/i18n/locales/achievements/no.json | 58 ++++++++-- src/i18n/locales/achievements/pt.json | 58 ++++++++-- src/i18n/locales/achievements/pt_BR.json | 58 ++++++++-- src/i18n/locales/achievements/ru.json | 58 ++++++++-- src/i18n/locales/achievements/tr_TR.json | 58 ++++++++-- src/i18n/locales/achievements/zh_CN.json | 58 ++++++++-- src/i18n/locales/bn.json | 3 +- src/i18n/locales/de_DE.json | 3 +- src/i18n/locales/en_US.json | 3 +- src/i18n/locales/es.json | 3 +- src/i18n/locales/es_419.json | 3 +- src/i18n/locales/fr.json | 3 +- src/i18n/locales/id_ID.json | 3 +- src/i18n/locales/nl.json | 3 +- src/i18n/locales/no.json | 3 +- src/i18n/locales/pt.json | 3 +- src/i18n/locales/pt_BR.json | 3 +- src/i18n/locales/ru.json | 3 +- src/i18n/locales/tr_TR.json | 3 +- src/i18n/locales/zh_CN.json | 3 +- 29 files changed, 795 insertions(+), 184 deletions(-) diff --git a/scripts/updatetranslations.js b/scripts/updatetranslations.js index e0317404..e46a9079 100644 --- a/scripts/updatetranslations.js +++ b/scripts/updatetranslations.js @@ -14,63 +14,72 @@ const compareAndRemoveKeys = (json1, json2) => { } }; -try { - const localesDir = path.join(__dirname, '../src/i18n/locales'); - const achievementsDir = path.join(localesDir, 'achievements'); +const localesDir = path.join(__dirname, '../src/i18n/locales'); +const achievementsDir = path.join(localesDir, 'achievements'); - // Check if the locales directory exists, if not, create it - if (!fs.existsSync(localesDir)) { - fs.mkdirSync(localesDir, { recursive: true }); - } - - // Check if the achievements directory exists, if not, create it - if (!fs.existsSync(achievementsDir)) { - fs.mkdirSync(achievementsDir, { recursive: true }); - } - - fs.readdirSync(localesDir).forEach((file) => { - if (file === 'en_GB.json') { - return; - } - - const en = require(path.join(localesDir, 'en_GB.json')); - const newdata = merge(en, require(path.join(localesDir, file))); - - compareAndRemoveKeys(newdata, en); - - fs.writeFileSync(path.join(localesDir, file), JSON.stringify(newdata, null, 2)); - - fs.appendFileSync(path.join(localesDir, file), '\n'); - }); - - fs.readdirSync(achievementsDir).forEach((file) => { - if (file === 'en_GB.json') { - return; - } - - const enGBFilePath = path.join(achievementsDir, 'en_GB.json'); - if (!fs.existsSync(enGBFilePath)) { - console.error(`File 'en_GB.json' does not exist in the directory '${achievementsDir}'`); - return; - } - - const en = require(enGBFilePath); - const newdata = merge(en, require(path.join(achievementsDir, file))); - - compareAndRemoveKeys(newdata, en); - - fs.writeFileSync(path.join(achievementsDir, file), JSON.stringify(newdata, null, 2)); - - fs.appendFileSync(path.join(achievementsDir, file), '\n'); - - const locales = fs.readdirSync(localesDir); - locales.forEach((locale) => { - if (!fs.existsSync(path.join(achievementsDir, locale))) { - fs.writeFileSync(path.join(achievementsDir, locale), JSON.stringify(en, null, 2)); - fs.appendFileSync(path.join(achievementsDir, locale), '\n'); - } - }); - }); -} catch (error) { - console.error(`An error occurred: ${error.message}`); +// Check if the locales directory exists, if not, create it +if (!fs.existsSync(localesDir)) { + fs.mkdirSync(localesDir, { recursive: true }); } + +// Check if the achievements directory exists, if not, create it +if (!fs.existsSync(achievementsDir)) { + fs.mkdirSync(achievementsDir, { recursive: true }); +} + +fs.readdirSync(localesDir).forEach((file) => { + if (file === 'en_GB.json') { + return; + } + + if (fs.lstatSync(path.join(localesDir, file)).isDirectory()) { + return; + } + + const en = require(path.join(localesDir, 'en_GB.json')); + const newdata = merge(en, require(path.join(localesDir, file))); + + compareAndRemoveKeys(newdata, en); + + fs.writeFileSync(path.join(localesDir, file), JSON.stringify(newdata, null, 2)); + + fs.appendFileSync(path.join(localesDir, file), '\n'); +}); + +fs.readdirSync(achievementsDir).forEach((file) => { + if (file === 'en_GB.json') { + return; + } + + if (fs.lstatSync(path.join(achievementsDir, file)).isDirectory()) { + return; + } + + const enGBFilePath = path.join(achievementsDir, 'en_GB.json'); + if (!fs.existsSync(enGBFilePath)) { + console.error(`File 'en_GB.json' does not exist in the directory '${achievementsDir}'`); + return; + } + + const en = require(enGBFilePath); + const newdata = merge(en, require(path.join(achievementsDir, file))); + + compareAndRemoveKeys(newdata, en); + + fs.writeFileSync(path.join(achievementsDir, file), JSON.stringify(newdata, null, 2)); + + fs.appendFileSync(path.join(achievementsDir, file), '\n'); + + const locales = fs.readdirSync(localesDir); + locales.forEach((locale) => { + if (!fs.existsSync(path.join(achievementsDir, locale))) { + // ignore directories + if (fs.lstatSync(path.join(localesDir, locale)).isDirectory()) { + return; + } + + fs.writeFileSync(path.join(achievementsDir, locale), JSON.stringify(en, null, 2)); + fs.appendFileSync(path.join(achievementsDir, locale), '\n'); + } + }); +}); diff --git a/src/i18n/locales/achievements/bn.json b/src/i18n/locales/achievements/bn.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/bn.json +++ b/src/i18n/locales/achievements/bn.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/de_DE.json b/src/i18n/locales/achievements/de_DE.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/de_DE.json +++ b/src/i18n/locales/achievements/de_DE.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/en_US.json b/src/i18n/locales/achievements/en_US.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/en_US.json +++ b/src/i18n/locales/achievements/en_US.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/es.json b/src/i18n/locales/achievements/es.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/es.json +++ b/src/i18n/locales/achievements/es.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/es_419.json b/src/i18n/locales/achievements/es_419.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/es_419.json +++ b/src/i18n/locales/achievements/es_419.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/fr.json b/src/i18n/locales/achievements/fr.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/fr.json +++ b/src/i18n/locales/achievements/fr.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/id_ID.json b/src/i18n/locales/achievements/id_ID.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/id_ID.json +++ b/src/i18n/locales/achievements/id_ID.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/nl.json b/src/i18n/locales/achievements/nl.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/nl.json +++ b/src/i18n/locales/achievements/nl.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/no.json b/src/i18n/locales/achievements/no.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/no.json +++ b/src/i18n/locales/achievements/no.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/pt.json b/src/i18n/locales/achievements/pt.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/pt.json +++ b/src/i18n/locales/achievements/pt.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/pt_BR.json b/src/i18n/locales/achievements/pt_BR.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/pt_BR.json +++ b/src/i18n/locales/achievements/pt_BR.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/ru.json b/src/i18n/locales/achievements/ru.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/ru.json +++ b/src/i18n/locales/achievements/ru.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/tr_TR.json b/src/i18n/locales/achievements/tr_TR.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/tr_TR.json +++ b/src/i18n/locales/achievements/tr_TR.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/achievements/zh_CN.json b/src/i18n/locales/achievements/zh_CN.json index 8dcc1526..6859159a 100644 --- a/src/i18n/locales/achievements/zh_CN.json +++ b/src/i18n/locales/achievements/zh_CN.json @@ -1,8 +1,50 @@ -[ - "Opened 10 tabs", - "Opened 39 tabs", - "Opened 100 tabs", - "Opened 305 tabs", - "Installed an add-on", - "Installed 5 add-ons" -] +{ + "727": { + "name": "When You See It", + "description": "Opened 727 tabs" + }, + "1337": { + "name": "MU3T4B", + "description": "Opened 1337 tabs" + }, + "10tabs": { + "name": "10/10 IGN", + "description": "Opened 10 tabs" + }, + "thankyou": { + "name": "Thank You", + "description": "Opened 39 tabs" + }, + "seasoning": { + "name": "Seasoning", + "description": "Opened 100 tabs" + }, + "mrworldwide": { + "name": "Mr. Worldwide", + "description": "Opened 305 tabs" + }, + "tabaholic": { + "name": "Tabaholic", + "description": "Opened 500 tabs" + }, + "808s": { + "name": "808s & Tab Breaks", + "description": "Opened 808 tabs" + }, + "averagelinuxuser": { + "name": "Average Linux User", + "description": "Installed an add-on" + }, + "fullyriced": { + "name": "Fully Riced", + "description": "Installed 5 add-ons" + }, + "21addons": { + "name": "They installed 21 add-ons? Whaaat?", + "description": "Installed 21 add-ons" + }, + "overload": { + "name": "System Overload", + "description": "Installed 50 add-ons" + } +} diff --git a/src/i18n/locales/bn.json b/src/i18n/locales/bn.json index 6f26bbb0..4304c4f4 100644 --- a/src/i18n/locales/bn.json +++ b/src/i18n/locales/bn.json @@ -676,6 +676,7 @@ "error": "Something went wrong", "imported": "Successfully imported", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/de_DE.json b/src/i18n/locales/de_DE.json index b08ef32a..b1c7f2aa 100644 --- a/src/i18n/locales/de_DE.json +++ b/src/i18n/locales/de_DE.json @@ -676,6 +676,7 @@ "error": "Etwas ist schief gelaufen", "imported": "Erfolgreich importiert", "no_storage": "Nicht genügend Speicherplatz", - "link_copied": "Link kopiert" + "link_copied": "Link kopiert", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/en_US.json b/src/i18n/locales/en_US.json index 5f8dad0d..9f0f96b5 100644 --- a/src/i18n/locales/en_US.json +++ b/src/i18n/locales/en_US.json @@ -676,6 +676,7 @@ "error": "Something went wrong", "imported": "Successfully imported", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index c2ffdfe3..01987a3d 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -676,6 +676,7 @@ "error": "Algo salió mal", "imported": "Importado correctamente", "no_storage": "No hay espacio suficiente", - "link_copied": "Enlace copiado" + "link_copied": "Enlace copiado", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/es_419.json b/src/i18n/locales/es_419.json index eb928f1c..0ee96dd5 100644 --- a/src/i18n/locales/es_419.json +++ b/src/i18n/locales/es_419.json @@ -676,6 +676,7 @@ "error": "Algo salió mal", "imported": "Importado correctamente", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index c0413807..b8fb2e24 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -676,6 +676,7 @@ "error": "Quelque chose s'est mal passé", "imported": "Importé avec succès", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/id_ID.json b/src/i18n/locales/id_ID.json index ac8a0167..fa3cb3d9 100644 --- a/src/i18n/locales/id_ID.json +++ b/src/i18n/locales/id_ID.json @@ -676,6 +676,7 @@ "error": "Terdapat kesalahan", "imported": "Berhasil mengimpor", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/nl.json b/src/i18n/locales/nl.json index 01a1f9fa..89207ab9 100644 --- a/src/i18n/locales/nl.json +++ b/src/i18n/locales/nl.json @@ -676,6 +676,7 @@ "error": "Er is iets misgegaan", "imported": "Het importeren is voltooid", "no_storage": "Niet genoeg opslag", - "link_copied": "Link gekopieerd" + "link_copied": "Link gekopieerd", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/no.json b/src/i18n/locales/no.json index 48a816db..87ee6854 100644 --- a/src/i18n/locales/no.json +++ b/src/i18n/locales/no.json @@ -676,6 +676,7 @@ "error": "Noe gikk galt", "imported": "Successfully imported", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index d15623d6..b1ce7982 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -676,6 +676,7 @@ "error": "Algo deu errado", "imported": "Importado com sucesso", "no_storage": "Espaço de armazenamento insuficiente", - "link_copied": "Ligação copiada" + "link_copied": "Ligação copiada", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/pt_BR.json b/src/i18n/locales/pt_BR.json index f7f05831..9a7ff7f1 100644 --- a/src/i18n/locales/pt_BR.json +++ b/src/i18n/locales/pt_BR.json @@ -676,6 +676,7 @@ "error": "Algo deu errado", "imported": "Importado com sucesso", "no_storage": "Espaço de armazenamento insuficiente", - "link_copied": "Link copiado" + "link_copied": "Link copiado", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index d3638b6f..ad9dc363 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -676,6 +676,7 @@ "error": "Что-то пошло не так", "imported": "Успешно импортировано", "no_storage": "Недостаточно места", - "link_copied": "Ссылка скопирована" + "link_copied": "Ссылка скопирована", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/tr_TR.json b/src/i18n/locales/tr_TR.json index f097fd51..6cb3430b 100644 --- a/src/i18n/locales/tr_TR.json +++ b/src/i18n/locales/tr_TR.json @@ -676,6 +676,7 @@ "error": "Bir şeyler yanlış gitti.", "imported": "Başarıyla içe aktarıldı.", "no_storage": "Yeteri kadar yer yok.", - "link_copied": "Bağlantı kopyalandı." + "link_copied": "Bağlantı kopyalandı.", + "stats_reset": "Stats reset" } } diff --git a/src/i18n/locales/zh_CN.json b/src/i18n/locales/zh_CN.json index 796b56a1..2854260d 100644 --- a/src/i18n/locales/zh_CN.json +++ b/src/i18n/locales/zh_CN.json @@ -676,6 +676,7 @@ "error": "发生错误", "imported": "导入成功", "no_storage": "Not enough storage", - "link_copied": "Link copied" + "link_copied": "Link copied", + "stats_reset": "Stats reset" } } From 9b326737e1cd4ae7878d5829df7993436bfcbe9e Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 17 Mar 2024 12:00:18 +0000 Subject: [PATCH 2/3] experimental: fix changelog by switching it to github --- src/config/constants.js | 1 - src/features/misc/sections/About.jsx | 14 ++--- src/features/misc/sections/Changelog.jsx | 77 +++++++++++------------- 3 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/config/constants.js b/src/config/constants.js index f69cb60b..b7d266d7 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -8,7 +8,6 @@ export const OPENSTREETMAP_URL = 'https://www.openstreetmap.org'; // Mue URLs export const WEBSITE_URL = 'https://muetab.com'; export const PRIVACY_URL = 'https://muetab.com/privacy'; -export const BLOG_POST = 'https://blog.muetab.com/posts/version-7-0'; export const TRANSLATIONS_URL = 'https://docs.muetab.com/translations/'; export const WEBLATE_URL = 'https://hosted.weblate.org/projects/mue/mue-tab/'; export const REPORT_ITEM = diff --git a/src/features/misc/sections/About.jsx b/src/features/misc/sections/About.jsx index eb5c78b8..ecc08de4 100644 --- a/src/features/misc/sections/About.jsx +++ b/src/features/misc/sections/About.jsx @@ -131,7 +131,7 @@ class About extends PureComponent {
Logo
- Mue, By Kaiso + Mue, by Kaiso {variables.getMessage('modals.main.settings.sections.about.version.title')}{' '} {variables.constants.VERSION} @@ -156,8 +156,8 @@ class About extends PureComponent { > The Mue Authors - ,{' '} +

Copyright 2023-2024{' '} {this.state.loading}

: <>}
    {this.state.photographers.map(({ name, count }) => ( - <> -
  • - {name} - ({count} images) -
  • - +
  • + {name} + ({count} images) +
  • ))}
diff --git a/src/features/misc/sections/Changelog.jsx b/src/features/misc/sections/Changelog.jsx index 0718dd18..260b694e 100644 --- a/src/features/misc/sections/Changelog.jsx +++ b/src/features/misc/sections/Changelog.jsx @@ -18,10 +18,36 @@ class Changelog extends PureComponent { this.changelog = createRef(); } + parseMarkdown = (text) => { + text = text.replace(/^\* /gm, '
  • ').replace(/\n/g, '
  • '); + text = text.replace(/\*\*(.*?)\*\*/g, '$1'); + text = text.replace(/^## (.*$)/gm, '

    $1

    '); + text = text.replace( + /((http|https):\/\/[^\s]+)/g, + '
    $1', + ); + + return text; + } + async getUpdate() { - const res = await fetch(variables.constants.BLOG_POST + '/index.json', { - signal: this.controller.signal, - }); + const releases = await fetch( + `https://api.github.com/repos/${variables.constants.ORG_NAME}/${variables.constants.REPO_NAME}/releases`, + { + signal: this.controller.signal, + }, + ); + + // get the release which tag_name is the same as the current version + const data = await releases.json(); + const release = data.find((release) => release.tag_name === `7.0.0`); + + if (this.controller.signal.aborted === true) { + return; + } + + // request the changelog + const res = await fetch(release.url, { signal: this.controller.signal }); if (res.status === 404) { this.setState({ error: true }); @@ -32,43 +58,12 @@ class Changelog extends PureComponent { return; } - const data = await res.json(); - let date = new Date(data.date.split(' ')[0]); - date = date.toLocaleDateString(variables.languagecode.replace('_', '-'), { - year: 'numeric', - month: 'long', - day: 'numeric', - }); - + const changelog = await res.json(); this.setState({ - title: data.title, - date, - image: data.featured_image || null, - author: variables.getMessage('modals.main.settings.sections.changelog.by', { - author: data.authors.join(', '), - }), - content: data.markdown, + title: changelog.name, + content: this.parseMarkdown(changelog.body), + date: new Date(changelog.published_at).toLocaleDateString(), }); - - // lightbox etc - const images = this.changelog.current.getElementsByTagName('img'); - const links = this.changelog.current.getElementsByTagName('a'); - - for (const img of images) { - img.draggable = false; - img.onclick = () => { - this.setState({ - showLightbox: true, - lightboxImg: img.src, - }); - }; - } - - // open in new tab - for (let link = 0; link < links.length; link++) { - links[link].target = '_blank'; - links[link].rel = 'noopener noreferrer'; - } } componentDidMount() { @@ -129,9 +124,7 @@ class Changelog extends PureComponent { return (

    {this.state.title}

    -
    - {this.state.author} • {this.state.date} -
    +
    Released on {this.state.date}
    {this.state.image && ( )} -
    {this.state.content}
    +
    this.setState({ showLightbox: false })} From 89b8840bb70864b5883f96e36391961cab9a385c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 08:50:34 +0000 Subject: [PATCH 3/3] chore(deps): bump react-toastify from 10.0.4 to 10.0.5 (#672) Bumps [react-toastify](https://github.com/fkhadra/react-toastify) from 10.0.4 to 10.0.5. - [Release notes](https://github.com/fkhadra/react-toastify/releases) - [Commits](https://github.com/fkhadra/react-toastify/compare/v10.0.4...v10.0.5) --- updated-dependencies: - dependency-name: react-toastify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3ca7448f..e41e372a 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "react-dom": "^18.2.0", "react-icons": "^5.0.1", "react-modal": "3.16.1", - "react-toastify": "10.0.4" + "react-toastify": "10.0.5" }, "devDependencies": { "@commitlint/cli": "^19.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b025704a..1419e2e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ dependencies: specifier: 3.16.1 version: 3.16.1(react-dom@18.2.0)(react@18.2.0) react-toastify: - specifier: 10.0.4 - version: 10.0.4(react-dom@18.2.0)(react@18.2.0) + specifier: 10.0.5 + version: 10.0.5(react-dom@18.2.0)(react@18.2.0) devDependencies: '@commitlint/cli': @@ -5453,11 +5453,11 @@ packages: warning: 4.0.3 dev: false - /react-toastify@10.0.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-etR3RgueY8pe88SA67wLm8rJmL1h+CLqUGHuAoNsseW35oTGJEri6eBTyaXnFKNQ80v/eO10hBYLgz036XRGgA==} + /react-toastify@10.0.5(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==} peerDependencies: - react: '>=16' - react-dom: '>=16' + react: '>=18' + react-dom: '>=18' dependencies: clsx: 2.1.0 react: 18.2.0