[Connect] Remove for release

This commit is contained in:
child_duckling 2022-06-08 11:17:41 -07:00
parent 4ba9407a4f
commit f7a76d619c
3 changed files with 15 additions and 2 deletions

View file

@ -54,8 +54,18 @@ export class utils {
if (language !== "en_US" && fs.existsSync(path.join(this.paths.i18nPath, `${language}.json`))) {
i18n = Object.assign(i18n, JSON.parse(fs.readFileSync(path.join(this.paths.i18nPath, `${language}.json`), "utf8")));
} else if (!fs.existsSync(path.join(this.paths.i18nPath, `${language}.json`))) {
fetch(`https://raw.githubusercontent.com/ciderapp/Cider/main/src/i18n/${language}.json`)
.then(res => res.json())
.then(res => {
if (res) {
i18n = Object.assign(i18n, res);
fs.writeFileSync(path.join(this.paths.i18nPath, `${language}.json`), JSON.stringify(res));
} else {
i18n = Object.assign(i18n, JSON.parse(fs.readFileSync(path.join(this.paths.i18nPath, `en_US.json`), "utf8")));
}
})
}
if (key) {
return i18n[key]
} else {