mirror of
https://github.com/mue/mue.git
synced 2026-07-06 08:01:27 +02:00
refactor(welcome): Improved readability of changing tab + intro cleanup
Co-authored-by: David Ralph <me@davidcralph.co.uk> Co-authored-by: Isaac <contact@eartharoid.me>
This commit is contained in:
@@ -38,31 +38,30 @@ fs.readdirSync('../src/i18n/locales').forEach((file) => {
|
||||
fs.appendFileSync('../src/i18n/locales/' + file, '\n');
|
||||
});
|
||||
|
||||
|
||||
// do the same with achievements
|
||||
fs.readdirSync('../src/i18n/achievements').forEach((file) => {
|
||||
fs.readdirSync('../src/i18n/locales/achievements').forEach((file) => {
|
||||
if (file === 'en_GB.json') {
|
||||
return;
|
||||
}
|
||||
|
||||
const en = require('../src/i18n/achievements/en_GB.json');
|
||||
const newdata = merge(en, require('../src/i18n/achievements/' + file));
|
||||
const en = require('../src/i18n/locales/achievements/en_GB.json');
|
||||
const newdata = merge(en, require('../src/i18n/locales/achievements/' + file));
|
||||
|
||||
// remove strings not in english file
|
||||
compareAndRemoveKeys(newdata, en);
|
||||
|
||||
// write new file
|
||||
fs.writeFileSync('../src/i18n/achievements/' + file, JSON.stringify(newdata, null, 2));
|
||||
fs.writeFileSync('../src/i18n/locales/achievements/' + file, JSON.stringify(newdata, null, 2));
|
||||
|
||||
// add new line
|
||||
fs.appendFileSync('../src/i18n/achievements/' + file, '\n');
|
||||
fs.appendFileSync('../src/i18n/locales/achievements/' + file, '\n');
|
||||
|
||||
// if missing translations from locales/ add them to achievements/
|
||||
const locales = fs.readdirSync('../src/i18n/locales');
|
||||
locales.forEach((locale) => {
|
||||
if (!fs.existsSync('../src/i18n/achievements/' + locale)) {
|
||||
fs.writeFileSync('../src/i18n/achievements/' + locale, JSON.stringify(en, null, 2));
|
||||
fs.appendFileSync('../src/i18n/achievements/' + locale, '\n');
|
||||
if (!fs.existsSync('../src/i18n/locales/achievements/' + locale)) {
|
||||
fs.writeFileSync('../src/i18n/locales/achievements/' + locale, JSON.stringify(en, null, 2));
|
||||
fs.appendFileSync('../src/i18n/locales/achievements/' + locale, '\n');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user