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
+3
-1
@@ -28,7 +28,9 @@ String.prototype.rawformat = function rawFormat(object) {
|
||||
};
|
||||
|
||||
String.prototype.translate = function translate(language = 'zh_CN') {
|
||||
if (locales[language]) return locales[language][this] || this;
|
||||
if (locales[language]) {
|
||||
if (locales[language][this] !== undefined) return locales[language][this];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ const misc = require('./misc');
|
||||
|
||||
function Loader() { }
|
||||
Loader.prototype.getSource = function getSource(name) {
|
||||
if (!global.Hydro.template[name]) throw new Error();
|
||||
if (!global.Hydro.template[name]) throw new Error(`Cannot get template ${name}`);
|
||||
return {
|
||||
src: global.Hydro.template[name],
|
||||
path: name,
|
||||
|
||||
Reference in new issue
Block a user