Fix titles for widgets

Add translations
This commit is contained in:
Christophe Vilayphiou 2012-05-13 23:09:48 +08:00
parent 4ae8299949
commit 62e9a772f6
13 changed files with 22 additions and 14 deletions

View File

@ -2,7 +2,7 @@
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>
<%= f.radio_button :kind, kind, :class => 'part_kind' %> <%= f.radio_button :kind, kind, :class => 'part_kind' %>
<%= t(kind) %> <%= t(kind, :scope => 'admin.page_part_kinds') %>
<% end %> <% end %>
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>

View File

@ -200,6 +200,10 @@ en:
options: Options options: Options
orig_upload_file: Original filename orig_upload_file: Original filename
page: Page page: Page
page_part_kinds:
text: Text Area
public_r_tag: System Widget
module_widget: Plug-in Module Widget
position: Position position: Position
published?: Published? published?: Published?
purchase: Purchase purchase: Purchase

View File

@ -195,6 +195,10 @@ zh_tw:
options: 選項 options: 選項
orig_upload_file: 原上傳檔名 orig_upload_file: 原上傳檔名
page: 頁面管理 page: 頁面管理
page_part_kinds:
text: 文字區塊
public_r_tag: 系統模塊
module_widget: 外掛模塊
position: 位置 position: 位置
published?: 發布? published?: 發布?
purchase: 購買 purchase: 購買

View File

@ -183,7 +183,7 @@ module ParserCommon
ret << part.i18n_variable[I18n.locale] rescue '' ret << part.i18n_variable[I18n.locale] rescue ''
when 'module_widget' when 'module_widget'
url = "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" url = "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
options = "&category_id=#{!part[:category].blank? ? part[:category].blank? : params[:category_id]}&tag_id=#{!part[:tag].blank? ? part[:tag] : params[:tag_id]}&page=#{params[:page]}&part_title=part_title" options = "&category_id=#{!part[:category].blank? ? part[:category].blank? : params[:category_id]}&tag_id=#{!part[:tag].blank? ? part[:tag] : params[:tag_id]}&page=#{params[:page]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}"
ret << "<div class='dymanic_load' path='#{url + options}'></div>" ret << "<div class='dymanic_load' path='#{url + options}'></div>"
when 'public_r_tag' when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>" ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"

View File

@ -9,7 +9,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
# GET /bulletins.xml # GET /bulletins.xml
def index def index
@title = params[:page_title] @title = params[:part_title]
date_now = Time.now date_now = Time.now
if !params[:category_id].blank? if !params[:category_id].blank?
@bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) @bulletins = Bulletin.can_display.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)

View File

@ -3,9 +3,9 @@
<%= flash_messages %> <%= flash_messages %>
<% if @current_category %> <% if @current_category %>
<h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] + t('announcement.bulletin.list_lower') %></h1> <h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] %></h1>
<% else %> <% else %>
<h1 class="h1"><%= t('announcement.list_announcement') %></h1> <h1 class="h1"><%= t('announcement.announcement') %></h1>
<% end %> <% end %>

View File

@ -58,6 +58,7 @@ en:
announcement: announcement:
all_articles: List all_articles: List
add_new: Add add_new: Add
announcement: Announcement
categories: Categories categories: Categories
error: error:
no_avilb_cate_for_posting: You need a category to submit your post,please contact admin no_avilb_cate_for_posting: You need a category to submit your post,please contact admin
@ -66,7 +67,6 @@ en:
more: more+ more: more+
bulletins: Bulletins bulletins: Bulletins
related_links: Related Links related_links: Related Links
list_announcement: List Announcement
bulletin: bulletin:
submit_user_list: Submit User submit_user_list: Submit User
category: Category category: Category

View File

@ -37,6 +37,7 @@ zh_tw:
announcement: announcement:
add_new: 新增 add_new: 新增
all_articles: 列表 all_articles: 列表
announcement: 公告
error: error:
no_avilb_cate_for_posting: 您目前沒有分類可以刊登公告,請聯絡系統管理員為您開通分類 no_avilb_cate_for_posting: 您目前沒有分類可以刊登公告,請聯絡系統管理員為您開通分類
tags: 標籤 tags: 標籤
@ -47,7 +48,6 @@ zh_tw:
more: 更多+ more: 更多+
bulletins: 公告訊息 bulletins: 公告訊息
related_links: 相關連結 related_links: 相關連結
list_announcement: 公告列表
bulletin: bulletin:
category: 分類 category: 分類
submit_user_list: 張貼人 submit_user_list: 張貼人

View File

@ -9,7 +9,7 @@ class Panel::News::Widget::NewsBulletinsController < OrbitWidgetController
# GET /news_bulletins.xml # GET /news_bulletins.xml
def index def index
@title = params[:page_title] @title = params[:part_title]
date_now = Time.now date_now = Time.now
if !params[:category_id].blank? if !params[:category_id].blank?
@news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(5) @news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(5)

View File

@ -3,9 +3,9 @@
<%= flash_messages %> <%= flash_messages %>
<% if @current_category %> <% if @current_category %>
<h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] + t('news.news_bulletin.list_lower') %></h1> <h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] %></h1>
<% else %> <% else %>
<h1 class="h1"><%= t('news.list_news') %></h1> <h1 class="h1"><%= t('news.news') %></h1>
<% end %> <% end %>
<table class="table table-bordered"> <table class="table table-bordered">

View File

@ -63,7 +63,7 @@ en:
more: more+ more: more+
news_bulletins: NewsBulletins news_bulletins: NewsBulletins
related_links: Related Links related_links: Related Links
list_news: List News news: News
news_bulletin: news_bulletin:
category: Category category: Category
list_lower: " list" list_lower: " list"

View File

@ -43,9 +43,9 @@ zh_tw:
sure?: 確定嗎? sure?: 確定嗎?
campus_news: 校園新聞 campus_news: 校園新聞
more: 更多+ more: 更多+
news_bulletins: 公告訊息 news_bulletins: 新聞訊息
related_links: 相關連結 related_links: 相關連結
list_news: 公告列表 news: 新聞
news_bulletin: news_bulletin:
category: 分類 category: 分類
list_lower: 列表 list_lower: 列表

View File

@ -25,7 +25,7 @@ class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController
def home_list def home_list
@title = params[:page_title] @title = params[:part_title]
# deadline # deadline