From 115eb38a02fd02160e2b217d8cfbbbd4ee38ce02 Mon Sep 17 00:00:00 2001 From: whimlex Date: Tue, 10 Mar 2015 09:45:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=94=A8=E6=88=B7=E8=B5=84?= =?UTF-8?q?=E6=96=99=E6=A8=A1=E5=9D=97=EF=BC=8C=E7=94=A8=E6=88=B7=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E8=AF=BE=E7=A8=8B=E6=A0=8F=E3=80=81=E7=95=99=E8=A8=80?= =?UTF-8?q?=E6=A0=8F=E3=80=81=E9=A1=B9=E7=9B=AE=E6=A0=8F=E5=92=8C=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=A8=A1=E5=9D=97=E5=9B=BD=E9=99=85=E5=8C=96=EF=BC=9B?= =?UTF-8?q?=E5=AF=B9=E4=B8=80=E4=BA=9B=E5=AD=98=E5=82=A8=E5=9C=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A8=E4=B8=AD=E7=9A=84=E5=9B=BA=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=AF=94=E5=A6=82?= =?UTF-8?q?=E5=AD=A6=E6=9C=9F=EF=BC=8C=E8=81=8C=E7=A7=B0=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?helper=E5=92=8Cmodel=E4=B8=AD=E5=AE=9A=E4=B9=89=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=B0=81=E8=A3=85=EF=BC=9B=E5=B9=B3=E5=8F=B0=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=90=84?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=86=85=E9=83=A8=E5=AF=BC=E8=88=AA=E7=9A=84?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=EF=BC=9B=E8=AF=BE=E7=A8=8B=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=A8=A1=E5=9D=97=E5=9B=BD=E9=99=85=E5=8C=96=E6=95=B4?= =?UTF-8?q?=E7=90=86=E5=92=8C=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=8A=9F=E8=83=BD=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 24 +- app/helpers/welcome_helper.rb | 2 +- app/models/user_extensions.rb | 26 +- app/views/courses/index.html.erb | 2 +- app/views/courses/search.html.erb | 2 +- app/views/files/_attachement_list.html.erb | 2 +- app/views/forums/create_feedback.js.erb | 2 +- .../homework_attach/_add_jour_reply.html.erb | 4 +- app/views/homework_attach/_jour.html.erb | 2 +- .../_journal_reply_items.html.erb | 4 +- app/views/homework_attach/_review.html.erb | 2 +- app/views/homework_attach/_showjour.html.erb | 2 +- .../layouts/_base_homework_attach.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 6 +- app/views/layouts/base_forums.html.erb | 2 +- app/views/layouts/base_homework.html.erb | 2 +- app/views/layouts/base_memos.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- app/views/memos/new.html.erb | 4 +- app/views/my/account.html.erb | 4 +- app/views/projects/Copy of show.html.erb | 4 +- app/views/projects/_new_respond.html.erb | 4 +- app/views/stores/_search_bar.html.erb | 4 +- .../users/_activity_new_score_index.html.erb | 16 +- app/views/users/_course_form.html.erb | 2 +- .../users/_course_list_have_entity.html.erb | 4 +- .../_course_list_have_entity_ex.html.erb | 4 +- .../users/_influence_new_score_index.html.erb | 12 +- .../users/_project_new_score_index.html.erb | 4 +- .../users/_topic_new_score_index.html.erb | 12 +- app/views/users/show.html.erb | 51 ++- app/views/users/user_projects.html.erb | 2 +- app/views/welcome/_search_bar.html.erb | 4 +- app/views/welcome/contest.html.erb | 19 +- app/views/welcome/course.html.erb | 16 +- app/views/words/_feedback.html.erb | 2 +- app/views/words/_journal_reply_items.html.erb | 4 +- app/views/words/_message.html.erb | 2 +- app/views/words/_new_respond.html.erb | 4 +- config/locales/commons/en.yml | 103 +++++- config/locales/commons/zh.yml | 114 +++++- config/locales/contacts/en.yml | 15 + config/locales/courses/en.yml | 58 +++ config/locales/courses/zh.yml | 56 +++ config/locales/en.yml | 344 +++--------------- config/locales/forums/en.yml | 3 + config/locales/forums/zh.yml | 6 + config/locales/mailers/en.yml | 15 + config/locales/my/en.yml | 33 +- config/locales/my/zh.yml | 10 +- config/locales/navigatiors/en.yml | 77 ++++ config/locales/navigatiors/zh.yml | 11 +- config/locales/projects/en.yml | 56 +++ config/locales/projects/zh.yml | 46 ++- config/locales/users/en.yml | 202 +++++++++- config/locales/users/zh.yml | 198 +++++++--- config/locales/zh.yml | 245 +++++-------- 57 files changed, 1243 insertions(+), 617 deletions(-) create mode 100644 config/locales/forums/en.yml create mode 100644 config/locales/forums/zh.yml diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 22eb9bfae..db547061f 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -351,10 +351,28 @@ module CoursesHelper str end - # added by nwb + # added by meng + # 课程time+term简写(2014.春/2014.秋)国际化输出 def get_course_term course - str = ( course.try(:time).to_s << '.' << course.try(:term).to_s ) - str[0..-4] + strterm = course.try(:term).to_s + if !(User.current.language == 'zh') + strterm == '春季学期' ? strterm = 'spring term' : strterm = 'autumn term' + str = ( course.try(:time).to_s << '.' << strterm ) + str[0..-6] + else + str = ( course.try(:time).to_s << '.' << strterm ) + str[0..-4] + end + end + + # added by meng + # 课程term(春季学期/秋季学期)国际化输出 + def get_course_term_locales course + str = course.try(:term).to_s + if !(User.current.language == 'zh') + str == '春季学期' ? str = ' ' + 'spring term' : str = ' ' + 'autumn term' + end + return str end def members_to_user_ids members diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index eba3c0b3c..f6e205e82 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -341,7 +341,7 @@ module WelcomeHelper end str rescue Exception => e - str << content_tag("span", l(:field_user_active_unknow)) + str << content_tag("span", l('user.active.unknow')) end def show_event_reply event diff --git a/app/models/user_extensions.rb b/app/models/user_extensions.rb index b21f0ad36..92690d1db 100644 --- a/app/models/user_extensions.rb +++ b/app/models/user_extensions.rb @@ -33,16 +33,32 @@ class UserExtensions < ActiveRecord::Base return self.brief_introduction end -# added by bai +# added by meng def show_identity if self.identity == 0 - user_identity = '教师' + if User.current.language == 'zh' + user_identity = '教师' + else + user_identity = 'Teacher' + end elsif self.identity == 1 - user_identity = '学生' + if User.current.language == 'zh' + user_identity = '学生' + else + user_identity = 'Student' + end elsif self.identity == 2 - user_identity = '企业' + if User.current.language == 'zh' + user_identity = '企业' + else + user_identity = 'Enterprise' + end elsif self.identity == 3 - user_identity = '开发者' + if User.current.language == 'zh' + user_identity = '开发者' + else + user_identity = 'Developer' + end else user_identity = '' end diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index e7a4a29db..e8a917a2b 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -12,7 +12,7 @@ - 高校课程实践社区 + <%= l(:label_courses_community)%> diff --git a/app/views/courses/search.html.erb b/app/views/courses/search.html.erb index 661feb3c9..98b056487 100644 --- a/app/views/courses/search.html.erb +++ b/app/views/courses/search.html.erb @@ -7,7 +7,7 @@ - 高校课程实践社区 + <%= l(:label_courses_community)%> diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 85739f7c3..001519a28 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -37,7 +37,7 @@ :description_placeholder => l(:label_optional_description) } %> -