From 1f108464c28d99705af9100c914e0c2315fa85c8 Mon Sep 17 00:00:00 2001 From: "zhenjiang.dou" Date: Fri, 30 Dec 2016 12:57:44 +0800 Subject: [PATCH] update --- js/common.js | 37 +++++++------------------------- locales/lang.properties | 40 ----------------------------------- locales/lang_en_GB.properties | 1 + locales/lang_en_US.properties | 1 + locales/lang_ko_KR.properties | 1 + locales/lang_zh_CN.properties | 1 + locales/lang_zh_TW.properties | 1 + login.php | 7 +++++- 8 files changed, 19 insertions(+), 70 deletions(-) diff --git a/js/common.js b/js/common.js index 101339d..7408d5f 100644 --- a/js/common.js +++ b/js/common.js @@ -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"]) } - }); -} \ No newline at end of file + } +}); \ No newline at end of file diff --git a/locales/lang.properties b/locales/lang.properties index e701571..16cb8ce 100644 --- a/locales/lang.properties +++ b/locales/lang.properties @@ -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}! \ diff --git a/locales/lang_en_GB.properties b/locales/lang_en_GB.properties index b5336e2..493d6e4 100644 --- a/locales/lang_en_GB.properties +++ b/locales/lang_en_GB.properties @@ -1,3 +1,4 @@ +language = English home = Home production = Product news = News diff --git a/locales/lang_en_US.properties b/locales/lang_en_US.properties index b5336e2..493d6e4 100644 --- a/locales/lang_en_US.properties +++ b/locales/lang_en_US.properties @@ -1,3 +1,4 @@ +language = English home = Home production = Product news = News diff --git a/locales/lang_ko_KR.properties b/locales/lang_ko_KR.properties index f061cb3..7c71c2e 100644 --- a/locales/lang_ko_KR.properties +++ b/locales/lang_ko_KR.properties @@ -1,3 +1,4 @@ +language = Korean home = 홈 페이지 production = 생산 contact = 접촉 diff --git a/locales/lang_zh_CN.properties b/locales/lang_zh_CN.properties index 39fa02e..c66de6a 100644 --- a/locales/lang_zh_CN.properties +++ b/locales/lang_zh_CN.properties @@ -1,3 +1,4 @@ +language = Chinese_simplified home = 主页 production = 产品 news = 新闻 diff --git a/locales/lang_zh_TW.properties b/locales/lang_zh_TW.properties index 9283da5..a3fbd2d 100644 --- a/locales/lang_zh_TW.properties +++ b/locales/lang_zh_TW.properties @@ -1,3 +1,4 @@ +language = Chinese_traditional home = 主頁 production = 產品 news = 新聞 diff --git a/login.php b/login.php index fe9cc7b..0873eed 100644 --- a/login.php +++ b/login.php @@ -25,10 +25,15 @@

Please sign in

+ +