From 9f243e6d3c8d4ffcc17cec3c119dd3af8f2e5f29 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 19 Jul 2017 13:42:41 +1000 Subject: [PATCH] Fix title of /admin/content/edit Spree uses the global i18n key `contents` to print the title. A previous change made that an object containing other i18n keys which was then displayed as title. This change moves the i18n content to the scope of the view where they are displayed. --- app/controllers/admin/contents_controller.rb | 14 +++++++------- config/locales/en.yml | 15 +++++++-------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index 4a4c960e37..87e8995ac3 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -1,12 +1,12 @@ module Admin class ContentsController < Spree::Admin::BaseController def edit - @preference_sections = [{name: I18n.t('contents.header'), preferences: [:logo, :logo_mobile, :logo_mobile_svg]}, - {name: I18n.t('contents.home_page'), preferences: [:home_hero, :home_show_stats]}, - {name: I18n.t('contents.producer_signup_page'), preferences: [:producer_signup_pricing_table_html, :producer_signup_case_studies_html, :producer_signup_detail_html]}, - {name: I18n.t('contents.hub_signup_page'), preferences: [:hub_signup_pricing_table_html, :hub_signup_case_studies_html, :hub_signup_detail_html]}, - {name: I18n.t('contents.group_signup_page'), preferences: [:group_signup_pricing_table_html, :group_signup_case_studies_html, :group_signup_detail_html]}, - {name: I18n.t('contents.footer_and_external_links'), preferences: [:footer_logo, + @preference_sections = [{name: I18n.t('admin.contents.edit.header'), preferences: [:logo, :logo_mobile, :logo_mobile_svg]}, + {name: I18n.t('admin.contents.edit.home_page'), preferences: [:home_hero, :home_show_stats]}, + {name: I18n.t('admin.contents.edit.producer_signup_page'), preferences: [:producer_signup_pricing_table_html, :producer_signup_case_studies_html, :producer_signup_detail_html]}, + {name: I18n.t('admin.contents.edit.hub_signup_page'), preferences: [:hub_signup_pricing_table_html, :hub_signup_case_studies_html, :hub_signup_detail_html]}, + {name: I18n.t('admin.contents.edit.group_signup_page'), preferences: [:group_signup_pricing_table_html, :group_signup_case_studies_html, :group_signup_detail_html]}, + {name: I18n.t('admin.contents.edit.footer_and_external_links'), preferences: [:footer_logo, :footer_facebook_url, :footer_twitter_url, :footer_instagram_url, :footer_linkedin_url, :footer_googleplus_url, :footer_pinterest_url, :footer_email, :community_forum_url, :footer_links_md, :footer_about_url, :footer_tos_url]}] end @@ -21,7 +21,7 @@ module Admin # Save any uploaded images ContentConfig.save - flash[:success] = t(:successfully_updated, :resource => I18n.t('contents.your_content')) + flash[:success] = t(:successfully_updated, :resource => I18n.t('admin.contents.edit.your_content')) redirect_to main_app.edit_admin_content_path end diff --git a/config/locales/en.yml b/config/locales/en.yml index 78d1f1cf0e..f0e3f05fcb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -295,6 +295,13 @@ en: contents: edit: title: Content + header: Header + home_page: Home page + producer_signup_page: Producer signup page + hub_signup_page: Hub signup page + group_signup_page: Group signup page + footer_and_external_links: Footer and External Links + your_content: Your content enterprise_fees: index: @@ -1847,14 +1854,6 @@ Please follow the instructions there to make your enterprise visible on the Open order_cycles_no_permission_to_coordinate_error: "None of your enterprises have permission to coordinate an order cycle" order_cycles_no_permission_to_create_error: "You don't have permission to create an order cycle coordinated by that enterprise" order_cycles_no_permission_to_delete_error: "That order cycle has been selected by a customer and cannot be deleted. To prevent customers from accessing it, please close it instead." - contents: - header: Header - home_page: Home page - producer_signup_page: Producer signup page - hub_signup_page: Hub signup page - group_signup_page: Group signup page - footer_and_external_links: Footer and External Links - your_content: Your content js: saving: 'Saving...' changes_saved: 'Changes saved.'