添加站内消息,修复讨论节点丢失的问题

This commit is contained in:
undefined committed 2020-05-03 15:33:54 +08:00
1 parent 33e277f28f
commit 627e64a901
44 files changed
+582 -540

No files matched your search

+11 -1
View File
@@ -21,13 +21,23 @@ String.prototype.format = function formatStr(...args) {
}
return result;
};
String.prototype.rawformat = function rawFormat(object) {
const res = this.split('{@}');
return [res[0], object, res[1]];
};
String.prototype.translate = function translate(language = 'zh_CN') {
if (locales[language]) return locales[language][this] || this;
return this;
};
module.exports = locales;
function load(data) {
for (const i in data) {
if (!locales[i]) locales[i] = data[i];
else locales[i] = Object.assign(locales[i], data[i]);
}
}
global.Hydro.locales = locales;
global.Hydro.lib.i18n = module.exports = load;