This commit is contained in:
undefined committed 2020-05-04 12:34:00 +08:00
1 parent 649f65b17d
commit e3bbff7e11
22 files changed
+315 -441

No files matched your search

+5 -5
View File
@@ -35,13 +35,13 @@ async function handler() {
}
async function locale() {
if (exist('.build/locale.js')) {
global.Hydro.lib.i18n(superRequire('.build/locale.js'));
if (exist('.build/locale.json')) {
global.Hydro.lib.i18n(superRequire('.build/locale.json'));
console.log('Locale init: builtin');
}
for (const i of installed) {
if (exist(`.build/module/${i}/locale.js`)) {
global.Hydro.lib.i18n(superRequire(`.build/module/${i}/locale.js`));
if (exist(`.build/module/${i}/locale.json`)) {
global.Hydro.lib.i18n(superRequire(`.build/module/${i}/locale.json`));
console.log(`Locale init: ${i}`);
}
}
@@ -54,7 +54,7 @@ async function template() {
console.log('Template init: builtin');
}
for (const i of installed) {
if (exist(`.build/module/${i}/locale.js`)) {
if (exist(`.build/module/${i}/template.yaml`)) {
const file = fs.readFileSync(root(`.build/module/${i}/template.yaml`)).toString();
Object.assign(global.Hydro.template, yaml.safeLoad(file));
console.log(`Template init: ${i}`);