diff --git a/js/common.js b/js/common.js index 101339d9f36d31818dd569d50c4c7491ed558a62..7408d5ffe6b1306cc7cadde635682054a3c49887 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 e701571a23bc36fe4cd3b5cd693c39e8104af152..16cb8ce4787f0b4f3bae3ed60dabbb83d6f40f2a 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 b5336e2a31f7710f36a4b9af9e415c9e6553960d..493d6e4509502a9d6cd8b2a57e8782e309af8f2c 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 b5336e2a31f7710f36a4b9af9e415c9e6553960d..493d6e4509502a9d6cd8b2a57e8782e309af8f2c 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 f061cb3ab46c67c788be68c57e52308641166b25..7c71c2e6b55eeee60054293a5252324179ee8e1f 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 39fa02e5dcc268d3d93df09e44b7e4705bfba826..c66de6a538096f4f010976f7bfac0a7d773e4a6b 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 9283da50dc02c8f570bb40cd689cdc3c4a299961..a3fbd2d219fd50c78bb8b8861a2ad8669759d2d9 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 fe9cc7ba3bb2c14577c267436ec1bcbadaa0042a..0873eed4fe012083c36023927f8b43987546c139 100644 --- a/login.php +++ b/login.php @@ -25,10 +25,15 @@