From cc81695bc3c3cfea420d18380e4fbfde1dafe6b6 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 27 Oct 2014 17:30:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B5=84=E6=96=99=E3=80=8B=E4=B8=AD=E8=8B=B1=E6=96=87=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=A7=B0=E7=9A=84bug,=E8=A7=81=E7=BC=BA=E9=99=B7http:?= =?UTF-8?q?//forge.trustie.net/issues/1846=5FTrustie-Forge(1328-1418)=20Si?= =?UTF-8?q?gned-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 48 ++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 57eaa93d1..74de20ab7 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -171,6 +171,7 @@ <% city = User.current.user_extensions.location_city %> <% identity = User.current.user_extensions.identity %> <% title = User.current.user_extensions.technical_title %> + <% language = User.current.language %> @@ -499,15 +501,55 @@ } } } - function init_identity_and_title(pField, identity, cField, title) { + function init_identity_and_title(pField, identity, cField, title, language) { for (var i = 0; i < pField.options.length; i++) { if (pField.options[i].value == identity) { pField.selectedIndex = i; } } showtechnical_title(identity, cField); + + if(language == 'zh') { + switch (title) { + case 'Professor' : + title1 = '教授'; + break; + case 'Associate professor' : + title1 = '副教授'; + break; + case 'Lecturer' : + title1 = '讲师'; + break; + case 'Teaching assistant' : + title1 = '助教'; + break; + default : + title1 = title; + break; + } + } + else { + switch (title) { + case '教授' : + title1 = 'Professor'; + break; + case '副教授' : + title1 = 'Associate professor'; + break; + case '讲师' : + title1 = 'Lecturer'; + break; + case '助教' : + title1 = 'Teaching assistant'; + break; + default : + title1 = title; + break; + } + } + for (var i = 0; i < cField.options.length; i++) { - if (cField.options[i].value == title) { + if (cField.options[i].value == title1) { cField.selectedIndex = i; } }