mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-23 05:18:12 -05:00
使能中文翻译
This commit is contained in:
parent
4ce44527c4
commit
2195b853b3
@ -1,10 +1,10 @@
|
||||
<!doctype html>
|
||||
<html lang="en" dir="ltr">
|
||||
<html lang="zh" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Language" content="zh">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
@ -27,7 +27,7 @@
|
||||
<noscript>
|
||||
<div class="container no-js-warning">
|
||||
<div class="alert alert-warning text-center">
|
||||
<strong>Warning!</strong> This application requires Javascript and your browser doesn't support it.
|
||||
<strong>警告!</strong> 此应用程序需要Javascript,而您的浏览器不支持它。
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
|
@ -2,7 +2,7 @@ const UserModel = require('../models/user');
|
||||
|
||||
let cache = {
|
||||
User: new UserModel.Model(),
|
||||
locale: 'en',
|
||||
locale: 'zh',
|
||||
version: null
|
||||
};
|
||||
|
||||
|
@ -10,13 +10,13 @@ module.exports = function (namespace, key, data) {
|
||||
let locale = Cache.locale;
|
||||
// check that the locale exists
|
||||
if (typeof messages[locale] === 'undefined') {
|
||||
locale = 'en';
|
||||
locale = 'zh';
|
||||
}
|
||||
|
||||
if (typeof messages[locale][namespace] !== 'undefined' && typeof messages[locale][namespace][key] !== 'undefined') {
|
||||
return messages[locale][namespace][key](data);
|
||||
} else if (locale !== 'en' && typeof messages['en'][namespace] !== 'undefined' && typeof messages['en'][namespace][key] !== 'undefined') {
|
||||
return messages['en'][namespace][key](data);
|
||||
} else if (locale !== 'zh' && typeof messages['zh'][namespace] !== 'undefined' && typeof messages['zh'][namespace][key] !== 'undefined') {
|
||||
return messages['zh'][namespace][key](data);
|
||||
}
|
||||
|
||||
return '(MISSING: ' + namespace + '/' + key + ')';
|
||||
|
@ -12,5 +12,6 @@
|
||||
<%- i18n('main', 'version', {version: getVersion()}) %>
|
||||
<%= i18n('footer', 'copy', {url: 'https://jc21.com?utm_source=nginx-proxy-manager'}) %>
|
||||
<%= i18n('footer', 'theme', {url: 'https://tabler.github.io/?utm_source=nginx-proxy-manager'}) %>
|
||||
<%= i18n('footer', 'translate', {url: 'https://github.com/xiaoxinpro/nginx-proxy-manager-zh'}) %>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user