From 13d95ecf1dc0e079806d46ab49f0c3be2535e26e Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 27 Sep 2022 15:55:24 +1000 Subject: [PATCH] Scope Enterprise Group side menu translations With it's own lazy scope, we no longer need to define labels separately. --- app/helpers/admin/enterprise_groups_helper.rb | 13 ++++++------- app/views/admin/shared/_side_menu.html.haml | 2 +- config/locales/en.yml | 10 ++++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/helpers/admin/enterprise_groups_helper.rb b/app/helpers/admin/enterprise_groups_helper.rb index 11ad3c81ac..cc2d271cf8 100644 --- a/app/helpers/admin/enterprise_groups_helper.rb +++ b/app/helpers/admin/enterprise_groups_helper.rb @@ -4,13 +4,12 @@ module Admin module EnterpriseGroupsHelper def enterprise_group_side_menu_items [ - { name: 'primary_details', label: 'primary_details', icon_class: "icon-user", - selected: "selected" }, - { name: 'users', label: 'users', icon_class: "icon-user" }, - { name: 'about', label: 'about', icon_class: "icon-pencil" }, - { name: 'images', label: 'images', icon_class: "icon-picture" }, - { name: 'contact', label: 'admin_enterprise_groups_contact', icon_class: "icon-phone" }, - { name: 'web', label: 'admin_enterprise_groups_web', icon_class: "icon-globe" }, + { name: 'primary_details', icon_class: "icon-user", selected: "selected" }, + { name: 'users', icon_class: "icon-user" }, + { name: 'about', icon_class: "icon-pencil" }, + { name: 'images', icon_class: "icon-picture" }, + { name: 'contact', icon_class: "icon-phone" }, + { name: 'web', icon_class: "icon-globe" }, ] end end diff --git a/app/views/admin/shared/_side_menu.html.haml b/app/views/admin/shared/_side_menu.html.haml index 3cad9f9bd9..5a0df2ce50 100644 --- a/app/views/admin/shared/_side_menu.html.haml +++ b/app/views/admin/shared/_side_menu.html.haml @@ -9,5 +9,5 @@ - enterprise_group_side_menu_items.each do |item| %a.menu_item{ href: "##{item[:name]}_panel", class: item[:selected], id: item[:name], data: { action: "tabs-and-panels#changeActivePanel tabs-and-panels#changeActiveTab", "tabs-and-panels-target": "tab" } } %i{ class: item[:icon_class] } - %span= t("#{item[:label] }") + %span= t(".enterprise_group.#{item[:name] }") diff --git a/config/locales/en.yml b/config/locales/en.yml index 950f052d81..1550b837ec 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1286,6 +1286,14 @@ en: has_no_payment_methods: "%{enterprise} has no payment methods" has_no_shipping_methods: "%{enterprise} has no shipping methods" has_no_enterprise_fees: "%{enterprise} has no enterprise fees" + side_menu: + enterprise_group: + primary_details: "Primary Details" + users: "Users" + about: "About" + images: "Images" + contact: "Contact" + web: "Web Resources" enterprise_issues: create_new: Create New resend_email: Resend Email @@ -2515,7 +2523,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using admin_enterprise_groups_data_powertip: "The primary user responsible for this group." admin_enterprise_groups_data_powertip_logo: "This is the logo for the group" admin_enterprise_groups_data_powertip_promo_image: "This image is displayed at the top of the Group profile" - admin_enterprise_groups_contact: "Contact" admin_enterprise_groups_contact_phone_placeholder: "eg. 98 7654 3210" admin_enterprise_groups_contact_address1_placeholder: "eg. 123 High Street" admin_enterprise_groups_contact_city: "Suburb" @@ -2524,7 +2531,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using admin_enterprise_groups_contact_zipcode_placeholder: "eg. 3070" admin_enterprise_groups_contact_state_id: "State" admin_enterprise_groups_contact_country_id: "Country" - admin_enterprise_groups_web: "Web Resources" admin_enterprise_groups_web_twitter: "eg. @the_prof" admin_enterprise_groups_web_website_placeholder: "eg. www.truffles.com" admin_order_cycles: "Admin Order Cycles"