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) } %> -