From da6fd75d2a395bc5c0ba9117ef9a2a95681dc385 Mon Sep 17 00:00:00 2001 From: nccu Date: Fri, 6 Feb 2015 18:02:08 +0800 Subject: [PATCH] fix langs limit --- app/controllers/news_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index c945e24..2488c5b 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -134,9 +134,17 @@ class NewsController < ApplicationController } end + if I18n.locale.to_s == 'zh_tw' + subtitle = a.subtitle.truncate(100) + elsif I18n.locale.to_s == 'en' + subtitle = a.subtitle.truncate(200) + end + + + { "title" => HTMLEntities.new.encode(a.title), - "subtitle" => a.subtitle.truncate(100), + "subtitle" => subtitle, "statuses" => statuses, "category" => a.category.title, "postdate" => a.postdate,