mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
wiki
This commit is contained in:
1 parent
649f65b17d
commit
e3bbff7e11
22 files changed
+315
-441
No files matched your search
+5
-5
@@ -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}`);
|
||||
|
||||
Reference in new issue
Block a user