mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: 支持系统级语言设置
This commit is contained in:
1 parent
5a7114ed8c
commit
1aeaf14a03
4 files changed
+10
-5
No files matched your search
@@ -43,7 +43,7 @@ String.prototype.rawformat = function rawFormat(object) {
|
||||
};
|
||||
|
||||
String.prototype.translate = function translate(...languages: string[]) {
|
||||
if (!languages.length) languages = ['zh_CN'];
|
||||
languages.push(global.Hydro.model.system.get('server.language'));
|
||||
for (const language of languages) {
|
||||
if (!language) continue;
|
||||
if (locales[language]) {
|
||||
|
||||
Reference in new issue
Block a user