From ec6fae79e46d6eae25c38345a1fbbc72379e2811 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 27 Jun 2018 23:51:50 +0800 Subject: [PATCH] fix for chinese company name --- app/models/employer_profile.rb | 14 ++++++++++++++ .../admin/recruitments/_member_index.html.erb | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/models/employer_profile.rb b/app/models/employer_profile.rb index 3de333f..e57dc22 100644 --- a/app/models/employer_profile.rb +++ b/app/models/employer_profile.rb @@ -29,6 +29,20 @@ class EmployerProfile end end + def get_company_name + if self.company_name.empty? + case I18n.locale + when :en + cname = self.company_name_translations["zh_tw"] + when :zh_tw + cname = self.company_name_translations["en"] + end + else + cname = self.company_name + end + return cname + end + def get_industry RecruitmentIndustry.find(self.industry).industry_title rescue "" end diff --git a/app/views/admin/recruitments/_member_index.html.erb b/app/views/admin/recruitments/_member_index.html.erb index c1ddff1..9531c5c 100644 --- a/app/views/admin/recruitments/_member_index.html.erb +++ b/app/views/admin/recruitments/_member_index.html.erb @@ -17,7 +17,7 @@ <% if user.is_employee? %> " target="_blank" ><%= user.name %> <% elsif user.is_employer? %> - <%= user.profile.company_name %> + <%= user.profile.get_company_name %> <% end %> <%= t("recruitment.user_type.type#{user.user_type.to_s}") %>