This commit is contained in:
zhenjiang.dou 2016-12-30 12:57:44 +08:00
parent a8e5cc44a2
commit 1f108464c2
8 changed files with 19 additions and 70 deletions

View file

@ -2,14 +2,14 @@ jQuery.i18n.properties({
name: 'lang',
path: './locales/',
mode: 'both',
// language: 'zh_CN',
language: 'zh_CN',
checkAvailableLanguages: true,
async: true,
cache: true,
callback: function () {
jQuery("html").attr("lang", jQuery.i18n.normaliseLanguageCode());
$("[data-i18n]").each(function () {
var elem = $(this),
localizedValue = jQuery.i18n.map[elem.data("i18n")];
var elem = $(this), localizedValue = jQuery.i18n.map[elem.data("i18n")];
if (elem.is("input[type=text]") || elem.is("input[type=password]") || elem.is("input[type=email]")) {
elem.attr("placeholder", localizedValue);
} else if (elem.is("input[type=button]") || elem.is("input[type=submit]")) {
@ -18,30 +18,9 @@ jQuery.i18n.properties({
elem.text(localizedValue);
}
});
}
});
function turnPage(url) {
$.ajax({
url: url,
cache: false,
success: function (html) {
$("#content").html(html);
},
error: function () {
$.ajax({
type: "post",
url: url,
cache: false,
dataType: "jsonp",
jsonp: "callback", // 传递给请求处理程序或页面的用以获得jsonp回调函数名的参数名(默认为:callback)
jsonpCallback: "success_jsonpCallback", // 自定义的jsonp回调函数名称默认为jQuery自动生成的随机函数名
success: function (html) {
$("#content").html(html);
},
error: function () {
alert('fail');
}
});
if (window.location.pathname == "/login.php") {
console.log(jQuery.i18n.map["language"]);
jQuery("input[name=language]").attr("value", jQuery.i18n.map["language"])
}
});
}
}
});

View file

@ -1,43 +1,3 @@
home = Home
production = Product
news = News
contact = Contact
contact_us = Contact Us
help = Help
login = Login
signup = Signup
username = Username
input_username = Please Input Username
password = Password
input_password = Please Input Password
email = Email
input_email = Please Input Email Address
site_category = Site Category
personal = Personal
business = Business
hobby = Hobby
forum = Forum
adult = Adult
dating = Dating
software_download = Software / Download
choose_from_below = Choose from Below
site_language = Site Language
english = English
non_english = Non English
security_code = Security Code
input_security_code = Please Input Security Code
input_security_code_above = Please Input Security Code Above
legal_information = Legal Information
privacy_policy = Privacy Policy
tos = Terms of service
cancellation_refund = Cancellation & Refund
payment_methods = Payment Methods & Information
signup_free_hosting = Sign Up For Free Hosting
remember_me = Remember me
please_login = Please sign in
lost_password = Lost your password?
msg_hello = Hello
msg_world = World
msg_complex = Good morning {0}! \

View file

@ -1,3 +1,4 @@
language = English
home = Home
production = Product
news = News

View file

@ -1,3 +1,4 @@
language = English
home = Home
production = Product
news = News

View file

@ -1,3 +1,4 @@
language = Korean
home = 홈 페이지
production = 생산
contact = 접촉

View file

@ -1,3 +1,4 @@
language = Chinese_simplified
home = 主页
production = 产品
news = 新闻

View file

@ -1,3 +1,4 @@
language = Chinese_traditional
home = 主頁
production = 產品
news = 新聞

View file

@ -25,10 +25,15 @@
<h2 class="form-signin-heading" data-i18n="please_login">Please sign in</h2>
<input type="text" name="uname" class="form-control" placeholder="Username" data-i18n="input_username" required autofocus>
<input type="password" name="passwd" class="form-control" placeholder="Password" data-i18n="input_password" required>
<input type="hidden" name="language" value="English" data-i18n="language">
<select class="form-control" name="theme">
<option selected>cPanel X3</option>
<option>VistaPanel</option>
</select>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me"><span data-i18n="remember_me"> Remember me</span>
<a href="https://panel.byethost.com/lostpassword.php" data-i18n="lost_password">Lost your password?</a>
<a href="//cpanel.<?=$domain?>/lostpassword.php" data-i18n="lost_password">Lost your password?</a>
</label>
</div>
<button type="submit" name="submit" class="btn btn-lg btn-primary btn-block" data-i18n="login">Sign in</button>