From 8b2bc207def31fbc60eed26c80f0ecdf844ea6bf Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 12 Sep 2012 19:12:50 +0800 Subject: [PATCH 01/12] Changes for i18n yml --- Gemfile.lock | 14 +- app/assets/javascripts/bulletin_form.js.erb | 2 +- app/assets/javascripts/inc/ajax_setting.js | 12 +- .../javascripts/lib/contenteditable.js.erb | 4 +- .../javascripts/news_bulletin_form.js.erb | 2 +- app/controllers/admin/ad_images_controller.rb | 2 +- .../admin/asset_categories_controller.rb | 6 +- app/controllers/admin/assets_controller.rb | 4 +- app/controllers/admin/items_controller.rb | 7 - app/controllers/admin/links_controller.rb | 8 +- .../admin/module_apps_controller.rb | 28 +- .../module_apps_new_interface_controller.rb | 4 +- .../admin/object_auths_controller.rb | 2 +- .../object_auths_new_interface_controller.rb | 4 +- .../admin/page_parts_controller.rb | 2 +- app/controllers/admin/pages_controller.rb | 6 +- .../admin/translations_controller.rb | 81 -- app/controllers/admin/users_controller.rb | 8 +- app/controllers/application_controller.rb | 10 +- app/controllers/sessions_controller.rb | 2 +- app/helpers/admin/ad_banner_helper.rb | 4 +- app/helpers/admin/item_helper.rb | 4 +- app/helpers/admin/module_app_helper.rb | 2 +- app/helpers/admin/page_content_helper.rb | 4 +- app/helpers/admin/web_link_helper.rb | 2 +- app/helpers/orbit_backend_helper.rb | 2 +- .../admin/ad_banners/_ad_banner_tab.html.erb | 18 +- .../ad_banners/_ad_image_update.html.erb | 2 +- .../ad_banners/_modal_ad_banner_form.html.erb | 12 +- app/views/admin/ad_banners/index.html.erb | 2 +- app/views/admin/ad_images/_form.html.erb | 2 +- app/views/admin/app_auths/index.html.erb | 18 +- .../asset_categories/_asset_category.html.erb | 4 +- .../admin/asset_categories/index.html.erb | 2 +- app/views/admin/assets/_edit.html.erb | 4 +- app/views/admin/assets/_form.html.erb | 8 +- app/views/admin/assets/_new.html.erb | 4 +- app/views/admin/assets/_sort_headers.html.erb | 12 +- app/views/admin/assets/edit.html.erb | 2 +- app/views/admin/assets/file_upload.html.erb | 10 +- app/views/admin/assets/index.html.erb | 2 +- app/views/admin/assets/new.html.erb | 2 +- .../attributes/_attribute_field.html.erb | 2 +- app/views/admin/attributes/index.html.erb | 6 +- .../components/_user_role_management.html.erb | 14 +- app/views/admin/dashboards/index.html.erb | 2 +- app/views/admin/designs/_form.html.erb | 12 +- app/views/admin/designs/_new.html.erb | 2 +- .../admin/designs/_sort_headers.html.erb | 6 +- app/views/admin/designs/edit.html.erb | 2 +- app/views/admin/designs/index.html.erb | 2 +- app/views/admin/designs/new.html.erb | 2 +- app/views/admin/infos/_form.html.erb | 8 +- app/views/admin/links/_edit.html.erb | 4 +- app/views/admin/links/_form.html.erb | 67 +- app/views/admin/links/_new.html.erb | 4 +- app/views/admin/links/_show.html.erb | 45 +- app/views/admin/module_apps/edit.html.erb | 8 +- .../_modal_list.html.erb | 2 +- .../setting.html.erb | 5 +- app/views/admin/object_auths/index.html.erb | 8 +- .../_modal_list.html.erb | 2 +- .../setting.html.erb | 5 +- app/views/admin/page_parts/_edit.html.erb | 4 +- .../admin/page_parts/_module_widget.html.erb | 2 +- app/views/admin/pages/_edit.html.erb | 2 +- app/views/admin/pages/_form.html.erb | 16 +- app/views/admin/pages/_new.html.erb | 2 +- app/views/admin/purchases/index.html.erb | 10 +- app/views/admin/roles/_form.html.erb | 2 +- app/views/admin/roles/_sub_role.html.erb | 8 +- app/views/admin/sites/_registration.html.erb | 2 +- app/views/admin/sites/_side_bar.html.erb | 16 +- app/views/admin/sites/_update.html.erb | 4 +- app/views/admin/sites/mail_setting.html.erb | 16 +- app/views/admin/sites/site_info.html.erb | 24 +- .../admin/translations/_action_bar.html.erb | 1 - .../translations/_edit_language.html.erb | 16 - .../_edit_user_attribute_model.html.erb | 34 - .../admin/translations/_language.html.erb | 16 - .../_user_attribute_model.html.erb | 34 - app/views/admin/translations/edit.html.erb | 39 - app/views/admin/translations/index.html.erb | 72 -- app/views/admin/users/_form.html.erb | 8 +- app/views/admin/users/_side_bar.html.erb | 8 +- app/views/admin/users/index.html.erb | 14 +- app/views/layouts/_drop_down_menu.html.erb | 15 +- app/views/layouts/_orbit_bar.html.erb | 14 +- app/views/layouts/_side_bar.html.erb | 66 +- app/views/layouts/panel.html.erb | 46 - app/views/shared/_privilege_user.html.erb | 2 +- config/initializers/middle_site_connection.rb | 2 +- config/locales/en.yml | 581 ++++++------ config/locales/zh_tw.yml | 857 +++++++----------- config/mongoid.yml | 2 +- config/routes.rb | 2 - .../back_end/approvals_controller.rb | 8 +- .../back_end/bulletin_categorys_controller.rb | 10 +- .../back_end/bulletins_controller.rb | 2 +- .../back_end/bulletin_categorys_helper.rb | 4 +- .../announcement/app/models/bulletin.rb | 9 +- .../back_end/_announcement_secondary.html.erb | 14 - .../announcements/_list_table.html.erb | 15 - .../back_end/announcements/list_mine.html.erb | 12 - .../approvals/_modal_approve.html.erb | 10 +- .../back_end/approvals/_modal_list.html.erb | 2 +- .../back_end/approvals/setting.html.erb | 7 +- .../_modal_list.html.erb | 2 +- .../_bulletin_category.html.erb | 4 +- .../back_end/bulletin_categorys/edit.html.erb | 2 +- .../bulletin_categorys/index.html.erb | 2 +- .../back_end/bulletin_categorys/new.html.erb | 2 +- .../back_end/bulletins/_bulletin.html.erb | 10 +- .../back_end/bulletins/_filter.html.erb | 6 +- .../back_end/bulletins/_form.html.erb | 4 +- .../bulletins/_quick_edit_picture.html.erb | 2 +- .../back_end/bulletins/_sort_headers.html.erb | 12 +- .../back_end/bulletins/index.html.erb | 2 +- .../back_end/bulletins/show.html.erb | 18 +- .../front_end/bulletins/index.html.erb | 6 +- .../widget/bulletins/_index.html.erb | 4 +- .../bulletins_and_web_links.html.erb | 2 +- .../bulletins/bulletins_search_block.html.erb | 2 +- .../bulletins/bulletins_side_bar.html.erb | 4 +- .../announcement/config/locales/en.yml | 206 +---- .../announcement/config/locales/zh_tw.yml | 407 +-------- .../back_end/news_approvals_controller.rb | 8 +- .../news_bulletin_categorys_controller.rb | 6 +- .../back_end/news_bulletins_controller.rb | 4 +- .../news_bulletin_categorys_helper.rb | 4 +- .../back_end/fact_checks/setting.html.erb | 5 +- .../news_approvals/_modal_approve.html.erb | 10 +- .../news_approvals/_modal_list.html.erb | 2 +- .../back_end/news_approvals/setting.html.erb | 7 +- .../setting.html.erb | 7 +- .../_news_bulletin_category.html.erb | 4 +- .../news_bulletin_categorys/edit.html.erb | 2 +- .../news_bulletin_categorys/index.html.erb | 2 +- .../news_bulletin_categorys/new.html.erb | 2 +- .../back_end/news_bulletins/_filter.html.erb | 6 +- .../back_end/news_bulletins/_form.html.erb | 14 +- .../news_bulletins/_news_bulletin.html.erb | 12 +- .../_quick_edit_picture.html.erb | 2 +- .../news_bulletins/_sort_headers.html.erb | 14 +- .../back_end/news_bulletins/index.html.erb | 2 +- .../back_end/news_bulletins/show.html.erb | 18 +- .../front_end/news_bulletins/index.html.erb | 2 +- .../widget/news_bulletins/_index.html.erb | 6 +- .../news_bulletins/home_banner.html.erb | 4 +- .../news_bulletins_and_web_links.html.erb | 2 +- .../news_bulletins_side_bar.html.erb | 4 +- .../news/config/locales/en.yml | 193 +--- .../news/config/locales/zh_tw.yml | 404 +-------- .../page_contexts/_page_context.html.erb | 2 +- .../page_contexts/_sort_headers.html.erb | 8 +- .../page_contexts/_view_page_context.html.erb | 2 +- .../back_end/page_contexts/show.html.erb | 6 +- .../back_end/page_contexts/view.html.erb | 8 +- .../page_content/config/locales/en.yml | 134 +-- .../page_content/config/locales/zh_tw.yml | 333 +------ .../back_end/web_link_categorys_controller.rb | 6 +- .../_web_link_category.html.erb | 4 +- .../web_link_categorys/index.html.erb | 2 +- .../back_end/web_links/_form.html.erb | 4 +- .../back_end/web_links/_sort_headers.html.erb | 8 +- .../back_end/web_links/edit.html.erb | 2 +- .../back_end/web_links/index.html.erb | 2 +- .../front_end/web_links/index.html.erb | 4 +- .../widget/web_links/index.html.erb | 10 +- .../web_resource/config/locales/en.yml | 139 +-- .../web_resource/config/locales/zh_tw.yml | 247 +---- 171 files changed, 1215 insertions(+), 3717 deletions(-) delete mode 100644 app/controllers/admin/translations_controller.rb delete mode 100644 app/views/admin/translations/_action_bar.html.erb delete mode 100644 app/views/admin/translations/_edit_language.html.erb delete mode 100644 app/views/admin/translations/_edit_user_attribute_model.html.erb delete mode 100644 app/views/admin/translations/_language.html.erb delete mode 100644 app/views/admin/translations/_user_attribute_model.html.erb delete mode 100644 app/views/admin/translations/edit.html.erb delete mode 100644 app/views/admin/translations/index.html.erb delete mode 100644 app/views/layouts/panel.html.erb delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/_announcement_secondary.html.erb delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/announcements/_list_table.html.erb delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/announcements/list_mine.html.erb diff --git a/Gemfile.lock b/Gemfile.lock index cd992049..beb6db38 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM ruby2ruby (~> 1.2) ruport (~> 1.6) sass (~> 3.0) - bson (1.6.1) + bson (1.6.4) bson_ext (1.6.1) bson (~> 1.6.1) builder (3.0.0) @@ -130,18 +130,18 @@ GEM mime-types (1.17.2) mini_magick (3.4) subexec (~> 0.2.1) - mongo (1.6.1) - bson (~> 1.6.1) + mongo (1.6.2) + bson (~> 1.6.2) mongo_session_store-rails3 (3.0.5) actionpack (>= 3.0) mongo - mongoid (2.4.6) + mongoid (2.4.12) activemodel (~> 3.1) - mongo (~> 1.3) + mongo (<= 1.6.2) tzinfo (~> 0.3.22) mongoid-tree (0.7.0) mongoid (~> 2.0) - multi_json (1.1.0) + multi_json (1.3.6) mysql2 (0.3.11) mysql2 (0.3.11-x86-mingw32) net-ldap (0.3.1) @@ -301,7 +301,7 @@ GEM treetop (1.4.10) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.32) + tzinfo (0.3.33) uglifier (1.2.3) execjs (>= 0.3.0) multi_json (>= 1.0.2) diff --git a/app/assets/javascripts/bulletin_form.js.erb b/app/assets/javascripts/bulletin_form.js.erb index 18e8e375..902f815d 100644 --- a/app/assets/javascripts/bulletin_form.js.erb +++ b/app/assets/javascripts/bulletin_form.js.erb @@ -10,7 +10,7 @@ $('.bulletin_files_block a.delete').live('click', function(){ }); $(document).on('click', '.action a.remove_existing_record', function(){ - if(confirm("<%= I18n.t('announcement.sure?')%>")){ + if(confirm("<%= I18n.t(:sure?)%>")){ $(this).next('.should_destroy').attr('value', 1); $("tr#" + $(this).prev().attr('value')).hide(); } diff --git a/app/assets/javascripts/inc/ajax_setting.js b/app/assets/javascripts/inc/ajax_setting.js index c23a73bf..d2f183f0 100644 --- a/app/assets/javascripts/inc/ajax_setting.js +++ b/app/assets/javascripts/inc/ajax_setting.js @@ -1,7 +1,7 @@ -jQuery(document).ajaxStart(function(){ - $('').appendTo('body'); -}); +// jQuery(document).ajaxStart(function(){ +// $('').appendTo('body'); +// }); -jQuery(document).ajaxComplete(function(){ - $("#sys_modal").hide().remove(); -}); +// jQuery(document).ajaxComplete(function(){ +// $("#sys_modal").hide().remove(); +// }); diff --git a/app/assets/javascripts/lib/contenteditable.js.erb b/app/assets/javascripts/lib/contenteditable.js.erb index 40c19dd3..9d35acbe 100644 --- a/app/assets/javascripts/lib/contenteditable.js.erb +++ b/app/assets/javascripts/lib/contenteditable.js.erb @@ -40,11 +40,11 @@ $(".nav-tabs").find(".icons-pencil").click(function(){ data: { body: content_holder.html() }, success: function(json) { $(selector).attr("contenteditable",false) - alert("<%= I18n.t('admin.contenteditable.update_done') %>"); + alert("<%= I18n.t('update.success_') %>"); //content_holder.effect('highlight', {'color': '#0f0'}, 3000); }, error: function() { - alert("<%= I18n.t('admin.contenteditable.update_failed') %>"); + alert("<%= I18n.t('update.fail') %>"); //content_holder.effect('highlight', {'color': '#f00'}, 3000); content_holder.html(content); } diff --git a/app/assets/javascripts/news_bulletin_form.js.erb b/app/assets/javascripts/news_bulletin_form.js.erb index 092bbfff..2a96e6be 100644 --- a/app/assets/javascripts/news_bulletin_form.js.erb +++ b/app/assets/javascripts/news_bulletin_form.js.erb @@ -11,7 +11,7 @@ $('.news_bulletin_files_block a.delete').live('click', function(){ }); $(document).on('click', '.action a.remove_existing_record', function(){ - if(confirm("<%= I18n.t('news.sure?')%>")){ + if(confirm("<%= I18n.t(:sure?)%>")){ $(this).next('.should_destroy').attr('value', 1); $("tr#" + $(this).prev().attr('value')).hide(); } diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb index e3cef303..e4749ade 100644 --- a/app/controllers/admin/ad_images_controller.rb +++ b/app/controllers/admin/ad_images_controller.rb @@ -41,7 +41,7 @@ class Admin::AdImagesController < OrbitBackendController @ad_banner = AdBanner.find params[:ad_banner_id] @ad_image = @ad_banner.ad_images.find params[:id] if @ad_image.destroy - flash[:notice] = t('admin.success_destroy_ad_image') + flash[:notice] = t('ad.success_destroy_ad_image') redirect_to admin_ad_banner_path @ad_banner end end diff --git a/app/controllers/admin/asset_categories_controller.rb b/app/controllers/admin/asset_categories_controller.rb index 9ce6bb48..d406543b 100644 --- a/app/controllers/admin/asset_categories_controller.rb +++ b/app/controllers/admin/asset_categories_controller.rb @@ -25,7 +25,7 @@ class Admin::AssetCategoriesController < OrbitBackendController respond_to do |format| if @asset_category.save - format.html { redirect_to(admin_asset_categories_url, :notice => t('announcement.create_asset_category_success')) } + format.html { redirect_to(admin_asset_categories_url, :notice => t('create.success.asset_category')) } format.js else format.html { render :action => "new" } @@ -41,8 +41,8 @@ class Admin::AssetCategoriesController < OrbitBackendController respond_to do |format| if @asset_category.update_attributes(params[:asset_category]) - # format.html { redirect_to(panel_announcement_back_end_asset_category_url(@asset_category), :notice => t('asset_category.update_asset_category_success')) } - # format.html { redirect_to(panel_announcement_back_end_asset_categories_url, :notice => t('asset_category.update_asset_category_success')) } + # format.html { redirect_to(panel_announcement_back_end_asset_category_url(@asset_category), :notice => t('create.success')) } + # format.html { redirect_to(panel_announcement_back_end_asset_categories_url, :notice => t('create.success')) } # format.xml { head :ok } format.js else diff --git a/app/controllers/admin/assets_controller.rb b/app/controllers/admin/assets_controller.rb index aa82583f..77c52ffa 100644 --- a/app/controllers/admin/assets_controller.rb +++ b/app/controllers/admin/assets_controller.rb @@ -44,7 +44,7 @@ class Admin::AssetsController < OrbitBackendController # render :json=>{"url"=>@asset.data.url,"title"=>"xxx","desc"=>"sss"}.to_json render :layout=>false else - flash[:error] = t(:create_fail) + flash[:error] = t('create.fail') @asset_categories = AssetCategory.all @tags = AssetTag.all respond_to do |format| @@ -67,7 +67,7 @@ class Admin::AssetsController < OrbitBackendController format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'replaceWith', :id => "asset_#{@asset.id}", :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} } end else - flash[:error] = t(:update_fail) + flash[:error] = t('update.fail') @asset_categories = AssetCategory.all @tags = AssetTag.all respond_to do |format| diff --git a/app/controllers/admin/items_controller.rb b/app/controllers/admin/items_controller.rb index 1ea40640..e028ab68 100644 --- a/app/controllers/admin/items_controller.rb +++ b/app/controllers/admin/items_controller.rb @@ -4,7 +4,6 @@ class Admin::ItemsController < ApplicationController before_filter :authenticate_user! before_filter :find_parent_item - before_filter :find_snippets, :only => :index before_filter :is_admin? before_filter :set_current_item @@ -22,10 +21,4 @@ class Admin::ItemsController < ApplicationController render :nothing => true end - protected - - def find_snippets - @snippets = Snippet.where( { :parent_id => @parent_item.id } ) rescue nil - end - end diff --git a/app/controllers/admin/links_controller.rb b/app/controllers/admin/links_controller.rb index c233c18f..7c7b4030 100644 --- a/app/controllers/admin/links_controller.rb +++ b/app/controllers/admin/links_controller.rb @@ -23,7 +23,7 @@ class Admin::LinksController < ApplicationController @item = Link.new(params[:link]) if @item.save - flash.now[:notice] = t('admin.create_success_link') + flash.now[:notice] = t('create.success.link') respond_to do |format| format.html { redirect_to admin_link_url(@item) @@ -31,7 +31,7 @@ class Admin::LinksController < ApplicationController format.js {} end else - flash.now[:error] = t('admin.create_error_link') + flash.now[:error] = t('create.error.link') render :action => "new" end end @@ -40,7 +40,7 @@ class Admin::LinksController < ApplicationController @item = Link.find(params[:id]) if @item.update_attributes(params[:link]) - flash.now[:notice] = t('admin.update_success_link') + flash.now[:notice] = t('update.success.link') respond_to do |format| format.html { redirect_to admin_link_url(@item) @@ -48,7 +48,7 @@ class Admin::LinksController < ApplicationController format.js {} end else - flash.now[:error] = t('admin.update_error_link') + flash.now[:error] = t('update.error.link') render :action => "edit" end end diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb index 0c90f854..bf3661c8 100644 --- a/app/controllers/admin/module_apps_controller.rb +++ b/app/controllers/admin/module_apps_controller.rb @@ -58,14 +58,14 @@ class Admin::ModuleAppsController < ApplicationController def assign_sub_manager unless @assign_to_user.nil? || @assign_to_user.admin? if @module_app.assign_sub_manager(@assign_to_user,current_user) - flash[:notice] = t('admin.app_auth.assigning_manager.add_sub_manager_ok') + flash[:notice] = t('app_auth.assigning_manager.add_manager_ok') else - flash[:notice] = t('admin.app_auth.assigning_manager.add_sub_manager_fail') + flash[:notice] = t('app_auth.assigning_manager.add_manager_fail') end else - flash[:notice] = t('admin.app_auth.assigning_manager.failed_no_user') + flash[:notice] = t('app_auth.failed_no_user') end - flash[:notice] = t('admin.app_auth.can_not_add_this_user') + flash[:notice] = t('app_auth.can_not_add_this_user') redirect_to :action => "edit" end @@ -73,14 +73,14 @@ class Admin::ModuleAppsController < ApplicationController def assign_manager unless @assign_to_user.nil? || @assign_to_user.admin? if @module_app.assign_manager(@assign_to_user,current_user) - flash[:notice] = t('admin.app_auth.assigning_sub_manager.add_manager_ok') + flash[:notice] = t('app_auth.assigning_sub_manager.add_sub_manager_ok') else - flash[:notice] = t('admin.app_auth.assigning_sub_manager.add_manager_fail') + flash[:notice] = t('app_auth.assigning_sub_manager.add_sub_manager_fail') end else - flash[:notice] = t('admin.app_auth.assigning_sub_manager.failed_no_user') + flash[:notice] = t('app_auth.failed_no_user') end - flash[:notice] = t('admin.app_auth.can_not_add_this_user') + flash[:notice] = t('app_auth.can_not_add_this_user') redirect_to :action => "edit" end @@ -88,9 +88,9 @@ class Admin::ModuleAppsController < ApplicationController def remove_manager @app_manager = AppManager.find(params[:app_manager_id]) if @module_app.remove_manager(@app_manager.user) - flash[:notice] = t('admin.app_auth.delete_manager.success') + flash[:notice] = t('app_auth.delete_manager.success') else - flash[:notice] = t('admin.app_auth.delete_manager.fail') + flash[:notice] = t('app_auth.delete_manager.fail') end redirect_to :action => "edit" end @@ -99,9 +99,9 @@ class Admin::ModuleAppsController < ApplicationController def remove_sub_manager @app_sub_manager = AppManager.find(params[:app_sub_manager_id]) if @module_app.remove_sub_manager(@app_sub_manager.user) - flash[:notice] = t('admin.app_auth.delete_sub_manager.success') + flash[:notice] = t('app_auth.delete_sub_manager.success') else - flash[:notice] = t('admin.app_auth.delete_sub_manager.fail') + flash[:notice] = t('app_auth.delete_sub_manager.fail') end redirect_to :action => "edit" end @@ -115,7 +115,7 @@ class Admin::ModuleAppsController < ApplicationController return end #user is not permited to do that - flash[:notice] = t('admin.app_auth.operation_not_permitted') + flash[:notice] = t('app_auth.operation_not_permitted') render :nothing => true, :status => 403 end @@ -127,7 +127,7 @@ class Admin::ModuleAppsController < ApplicationController return end #user is not permited to do that - flash[:notice] = t('admin.app_auth.operation_not_permitted') + flash[:notice] = t('app_auth.operation_not_permitted') render :nothing => true, :status => 403 end diff --git a/app/controllers/admin/module_apps_new_interface_controller.rb b/app/controllers/admin/module_apps_new_interface_controller.rb index ab6dceee..31718624 100644 --- a/app/controllers/admin/module_apps_new_interface_controller.rb +++ b/app/controllers/admin/module_apps_new_interface_controller.rb @@ -25,9 +25,9 @@ class Admin::ModuleAppsNewInterfaceController < OrbitBackendController def update_setting module_app = update_setting_by_params if module_app.save! - flash[:notice] = t("admin.object_auth.update_done") + flash[:notice] = t('update.success_') else - flash[:notice] = t("admin.object_auth.update_failed") + flash[:notice] = t('update.fail') end end diff --git a/app/controllers/admin/object_auths_controller.rb b/app/controllers/admin/object_auths_controller.rb index b89a4fe6..dab659b4 100644 --- a/app/controllers/admin/object_auths_controller.rb +++ b/app/controllers/admin/object_auths_controller.rb @@ -30,7 +30,7 @@ class Admin::ObjectAuthsController < ApplicationController if @object_auth.save redirect_to edit_admin_object_auth_path(@object_auth) else - flash[:error] = t('admin.object.a_object_must_have_only_one_object_auth_profile_for_each_action') + flash[:error] = t('object.a_object_must_have_only_one_object_auth_profile_for_each_action') redirect_to (:back) end end diff --git a/app/controllers/admin/object_auths_new_interface_controller.rb b/app/controllers/admin/object_auths_new_interface_controller.rb index ac06602a..7728834d 100644 --- a/app/controllers/admin/object_auths_new_interface_controller.rb +++ b/app/controllers/admin/object_auths_new_interface_controller.rb @@ -18,9 +18,9 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController def update_setting ob_auth = update_setting_by_params if ob_auth.save! - flash[:notice] = t("admin.object_auth.update_done") + flash[:notice] = t('update.success_') else - flash[:notice] = t("admin.object_auth.update_failed") + flash[:notice] = t('update.fail') end end diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 17065bce..793f8637 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -47,7 +47,7 @@ class Admin::PagePartsController < ApplicationController @part = PagePart.find(params[:id]) if @part.update_attributes(params[:page_part]) set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') - flash.now[:notice] = t('admin.update_success_content') + flash.now[:notice] = t('update.success.content') if @part.page.name == 'home' expire_page '/' diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 5fc6cb77..f24b0526 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -56,7 +56,7 @@ class Admin::PagesController < ApplicationController end if @item.save - flash.now[:notice] = t('admin.create_success_page') + flash.now[:notice] = t('create.success.page') respond_to do |format| format.html { redirect_to admin_page_url(@item) @@ -64,7 +64,7 @@ class Admin::PagesController < ApplicationController format.js {} end else - flash.now[:error] = t('admin.create_error_page') + flash.now[:error] = t('create.error.page') @apps = ModuleApp.all @designs = Design.all.entries @design = Design.first @@ -80,7 +80,7 @@ class Admin::PagesController < ApplicationController end if @item.update_attributes(params[:page]) - flash[:notice] = t('admin.update_success_page') + flash[:notice] = t('update.success.page') respond_to do |format| format.html { redirect_to admin_page_url(@item) diff --git a/app/controllers/admin/translations_controller.rb b/app/controllers/admin/translations_controller.rb deleted file mode 100644 index 54da8762..00000000 --- a/app/controllers/admin/translations_controller.rb +++ /dev/null @@ -1,81 +0,0 @@ -class Admin::TranslationsController < ApplicationController - - layout "admin" - before_filter :authenticate_user! - before_filter :is_admin? - - def index - set_variables - end - - def edit - set_variables - end - - # Update either the i18n_variables or the languages - def update - begin - case params[:id] - # Update the i18n_variables - when 'all' - params[:i18n_variables].each do |id, var| - i18n_variable = I18nVariable.find(id) - i18n_variable.update_attributes(var) - end - # Add a language - when 'add' - site = Site.find(session[:site]) - if !site.valid_locales.include?(params[:language]) - site.valid_locales << params[:language] - site.save - I18nVariable.create({:key => params[:language], :document_class => 'language'}) - end - # Enable a language - when 'enable' - site = Site.find(session[:site]) - if !site.in_use_locales.include?(params[:enable_language]) - site.in_use_locales << params[:enable_language] - site.save - end - # Disable a language - when 'disable' - site = Site.find(session[:site]) - if site.in_use_locales.include?(params[:disable_language]) - site.in_use_locales.delete(params[:disable_language]) - site.save - end - # Delete a language and the corresponding i18n_variables - when 'delete' - site = Site.find(session[:site]) - site.in_use_locales.delete(params[:delete_language]) - site.valid_locales.delete(params[:delete_language]) - site.save - I18nVariable.destroy_all(:conditions => {:document_class => 'language', :key => params[:delete_language]}) - end - redirect_to admin_translations_url - rescue - set_variables - render :action => :edit - end - end - - protected - - # Get the i18n_variables and languages - def set_variables - @i18n_variables = I18nVariable.all.entries - @language_i18n_variables = @i18n_variables.inject([]) do |result, var| - result << var if var.document_class.eql?('language') - result - end - @role_i18n_variables = @i18n_variables.inject([]) do |result, var| - result << var if var.document_class.eql?('Role') - result - end - @info_i18n_variables = @i18n_variables.inject([]) do |result, var| - result << var if var.document_class.eql?('UserInfoModel') - result - end - end - -end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index ef44cfc1..e0c8a8f9 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -22,7 +22,7 @@ class Admin::UsersController < ApplicationController puts params.to_yaml @user = User.new(params[:user]) if @user.save - flash[:notice] = t('admin.create_success_user') + flash[:notice] = t('create.success.user') redirect_to :action => :index else render :action => :new @@ -42,10 +42,10 @@ class Admin::UsersController < ApplicationController @user.avatar = params[:file] if params[:file] if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b - flash.now[:error] = t('admin.cant_revoke_self_admin') + flash.now[:error] = t(:cant_revoke_self_admin) end if !flash[:error] && @user.update_attributes(params[:user]) - flash[:notice] = t('admin.update_success_user') + flash[:notice] = t('update.success.user') redirect_to :action => :index else get_info_and_roles @@ -55,7 +55,7 @@ class Admin::UsersController < ApplicationController def destroy if params[:id].eql?(session['warden.user.user.key'][1].to_s) - flash[:error] = t('admin.cant_delete_self') + flash[:error] = t(:cant_delete_self) else @user = User.find(params[:id]) @user.destroy diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 74274eeb..e8a3b65c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base if is_admin? true else - flash[:error] = t("admin.access.denied.not_admin") + flash[:error] = t("access.denied.not_admin") auth_failed_in_backend end end @@ -70,7 +70,7 @@ class ApplicationController < ActionController::Base if is_manager? true else - flash[:error] = t("admin.access.denied.app.not_manager") + flash[:error] = t("access.denied.app.not_manager") auth_failed_in_backend end end @@ -79,7 +79,7 @@ class ApplicationController < ActionController::Base if (@module_app.sub_managing_users.include?(current_user) || is_manager?) true else - flash[:error] = t("admin.access.denied.app.not_sub_manager") + flash[:error] = t("access.denied.app.not_sub_manager") auth_failed_in_backend end end @@ -88,13 +88,13 @@ class ApplicationController < ActionController::Base if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager ) true else - flash[:error] = t("admin.access.denied.app.not_authed_user") + flash[:error] = t("access.denied.app.not_authed_user") auth_failed_in_backend end end def check_object_premission(obj,title) - flash[:error] = t("admin.access.denied.object") + flash[:error] = t("access.denied.object") auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_user) || is_manager? || is_admin? ) end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index b2fbc997..fcb523dc 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -11,7 +11,7 @@ class SessionsController < Devise::SessionsController result = false ldap_filter = "(uid=#{login_uid})" if /@rulingcom.com$/.match(login_uid).nil? - MiddleSiteConnection.establish + # MiddleSiteConnection.establish NccuLdapConnection.establish if ($nccu_ldap_connection.bind rescue false) diff --git a/app/helpers/admin/ad_banner_helper.rb b/app/helpers/admin/ad_banner_helper.rb index ecba9b3b..feb3f6a6 100644 --- a/app/helpers/admin/ad_banner_helper.rb +++ b/app/helpers/admin/ad_banner_helper.rb @@ -22,8 +22,8 @@ module Admin::AdBannerHelper ad_banner.object_auths.new(title: type ).save oa = ad_banner.get_object_auth_by_title(type) end -# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa) - link_to t('admin.ad.cate_auth'),admin_object_auth_ob_auth_path(oa),:class => "btn btn-warning" +# link_to t(:category_auth), edit_admin_object_auth_path(oa) + link_to t(:category_auth),admin_object_auth_ob_auth_path(oa),:class => "btn btn-warning" end diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index f5b8589a..3e91f7a3 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -16,8 +16,8 @@ module Admin::ItemHelper ret << (link_to node.title, dest, :class => 'js_history') ret << "
" ret << (link_to t('admin.edit'), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), :class => 'js_history') if node.class.to_s.eql?('Page') - ret << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page js_history') if node.class.to_s.eql?('Page') - ret << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link js_history') if node.class.to_s.eql?('Page') + ret << (link_to t('new.page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page js_history') if node.class.to_s.eql?('Page') + ret << (link_to t('new.link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link js_history') if node.class.to_s.eql?('Page') ret << (link_to t(:delete), eval("delete_admin_#{node.class.to_s.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete js_history') ret << "
" ret << "" diff --git a/app/helpers/admin/module_app_helper.rb b/app/helpers/admin/module_app_helper.rb index 3ac82364..b041786f 100644 --- a/app/helpers/admin/module_app_helper.rb +++ b/app/helpers/admin/module_app_helper.rb @@ -15,6 +15,6 @@ module Admin::ModuleAppHelper def get_auth_by(manager_obj) showing_name = manager_obj.rule_creator==current_user ? t('me') : manager_obj.rule_creator.name - t("admin.user_role.auth.auth_by",:user_display_name => showing_name) + t("auth.auth_by",:user_display_name => showing_name) end end diff --git a/app/helpers/admin/page_content_helper.rb b/app/helpers/admin/page_content_helper.rb index 9f2b22e0..7c893774 100644 --- a/app/helpers/admin/page_content_helper.rb +++ b/app/helpers/admin/page_content_helper.rb @@ -11,8 +11,8 @@ include ActionView::Helpers::UrlHelper page_context.object_auths.new(title: type ).save rescue oa = page_context.get_object_auth_by_title(type) end -# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa) - link_to t('admin.page_context.ob_auth.edit'),admin_object_auth_ob_auth_path(oa) +# link_to t(:category_auth), edit_admin_object_auth_path(oa) + link_to t(:category_auth),admin_object_auth_ob_auth_path(oa) end end \ No newline at end of file diff --git a/app/helpers/admin/web_link_helper.rb b/app/helpers/admin/web_link_helper.rb index 0498f31b..2890eb51 100644 --- a/app/helpers/admin/web_link_helper.rb +++ b/app/helpers/admin/web_link_helper.rb @@ -6,6 +6,6 @@ module Admin::WebLinkHelper web_link.object_auths.new(title: type ).save oa = web_link.get_object_auth_by_title(type) end - link_to t('web_resource.cate_auth'),admin_object_auth_ob_auth_path(oa) + link_to t(:category_auth),admin_object_auth_ob_auth_path(oa) end end \ No newline at end of file diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index 3bc4d31b..23f49cbf 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -43,7 +43,7 @@ module OrbitBackendHelper end def show_toggle_archive_btn(object) - object.disable ? t("object_disable.change_to_false") : t("object_disable.change_to_true") + object.disable ? t(:disable) : t(:enable) end end \ No newline at end of file diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index d65a17e0..257b1571 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -2,26 +2,26 @@ <% if at_least_module_manager || sub_manager?(ad_banner_tab)%> <%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%>
- - <%= f.label :ad_fx, t('admin.ad.ab_fx') %> + + <%= f.label :ad_fx, t('ad.ab_fx') %> <%= f.select :ad_fx ,AdBanner::FX_TYPES %> - <%= f.label :transition_sec, t('admin.ad.transition_sec') %> - <%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> + <%= f.label :transition_sec, t('ad.transition_sec') %> + <%= f.text_field :transition_sec,:placeholder=>t('ad.sec_place_holder'),:class=> "span3" %> <%= t("ad.trans_unit_sec") %> <%if at_least_module_manager%> - <%= f.label :best_size, t('admin.ad.best_size') %> + <%= f.label :best_size, t('ad.best_size') %> <%= f.text_field :best_size %> Ex: 500px x 300px <% end -%>
- <%= f.submit t("admin.ad.update_banner"), :class => 'btn' %> + <%= f.submit t("ad.update_banner"), :class => 'btn' %> <%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
<% end -%> <% end -%> -

<%= t("admin.ad.picture_list")%>

+

<%= t("ad.picture_list")%>

<%if (at_least_module_manager || ad_banner_tab.cur_user_is_sub_manager_of(:edit) )%> <%= content_tag :div ,:class=>'adbanner-action' do%> - <%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> + <%= link_to t("ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%> <% end -%> <% end -%> @@ -30,7 +30,7 @@ <% if at_least_module_manager %> <%= show_ad_banner_permission_link ad_banner_tab%> - <%= link_to t('admin.ad.delete_banner'),admin_ad_banner_path(ad_banner_tab),:class => 'btn',:method => :delete,:confirm => t('sure?') %> + <%= link_to t('ad.delete_banner'),admin_ad_banner_path(ad_banner_tab),:class => 'btn',:method => :delete,:confirm => t('sure?') %> <% end -%> <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> diff --git a/app/views/admin/ad_banners/_ad_image_update.html.erb b/app/views/admin/ad_banners/_ad_image_update.html.erb index 0b4277a0..15bb75d0 100644 --- a/app/views/admin/ad_banners/_ad_image_update.html.erb +++ b/app/views/admin/ad_banners/_ad_image_update.html.erb @@ -1,7 +1,7 @@
  • <%= image_tag ad_image.file rescue nil%>

    - <%= ad_image.display? ? "[#{t('admin.ad.showing')}]" : "[#{t('admin.ad.not_showing')}]" %> + <%= ad_image.display? ? "[#{t('ad.showing')}]" : "[#{t('ad.not_showing')}]" %> <%= "#{ad_image.post_date ||'NeedReset' }~#{ad_image.unpost_date || 'NeedReset'}" %>

    <%if at_least_module_manager || sub_manager?(ad_image.ad_banner) %> diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index 68e0a9c6..dc77bc5f 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -4,33 +4,33 @@