mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-02 02:51:53 +08:00
初步的网页国际化支持
1. 添加 jquery i18n js 依赖和入口 2. 在登录界面添加语言切换功能
This commit is contained in:
29
web/share/js/i18n/i18n.js
Normal file
29
web/share/js/i18n/i18n.js
Normal file
@@ -0,0 +1,29 @@
|
||||
$(document).ready(function() {
|
||||
/*默认语言*/
|
||||
var defaultLang = "cn";
|
||||
$("[i18n]").i18n({
|
||||
defaultLang: defaultLang,
|
||||
filePath: "/share/i18n/",
|
||||
filePrefix: "i18n_",
|
||||
fileSuffix: "",
|
||||
forever: true,
|
||||
callback: function() {
|
||||
console.log("i18n is ready.");
|
||||
}
|
||||
});
|
||||
/*切换为中文 - 按钮*/
|
||||
$(".chinese").click(function() {
|
||||
$("[i18n]").i18n({
|
||||
defaultLang: "cn",
|
||||
filePath: "/share/i18n/"
|
||||
});
|
||||
});
|
||||
/*切换为英文 - 按钮*/
|
||||
$(".english").click(function() {
|
||||
$("[i18n]").i18n({
|
||||
defaultLang: "en",
|
||||
filePath: "/share/i18n/"
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user