From 034e86f4ac5a2344bb1cc23131672331183a248f Mon Sep 17 00:00:00 2001 From: ulferts Date: Wed, 5 Oct 2022 14:46:02 +0200 Subject: [PATCH] use project copy specific labels for copy options --- .../projects/copy/categories_dependent_service.rb | 2 +- .../projects/copy/members_dependent_service.rb | 2 +- .../projects/copy/overview_dependent_service.rb | 2 +- .../projects/copy/queries_dependent_service.rb | 2 +- .../copy/wiki_page_attachments_dependent_service.rb | 2 +- .../copy/work_package_attachments_dependent_service.rb | 2 +- config/locales/en.yml | 10 +++++++++- .../projects/copy/file_links_dependent_service.rb | 2 +- spec/features/projects/template_spec.rb | 2 +- 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/services/projects/copy/categories_dependent_service.rb b/app/services/projects/copy/categories_dependent_service.rb index c655709eb7..fdc45fea42 100644 --- a/app/services/projects/copy/categories_dependent_service.rb +++ b/app/services/projects/copy/categories_dependent_service.rb @@ -29,7 +29,7 @@ module Projects::Copy class CategoriesDependentService < Dependency def self.human_name - I18n.t(:label_work_package_category_plural) + I18n.t(:'projects.copy.work_package_categories') end def source_count diff --git a/app/services/projects/copy/members_dependent_service.rb b/app/services/projects/copy/members_dependent_service.rb index 1eeafbc58b..483849512f 100644 --- a/app/services/projects/copy/members_dependent_service.rb +++ b/app/services/projects/copy/members_dependent_service.rb @@ -29,7 +29,7 @@ module Projects::Copy class MembersDependentService < Dependency def self.human_name - I18n.t(:label_member_plural) + I18n.t(:'projects.copy.members') end def source_count diff --git a/app/services/projects/copy/overview_dependent_service.rb b/app/services/projects/copy/overview_dependent_service.rb index 3f4d0d19c8..9d32df8369 100644 --- a/app/services/projects/copy/overview_dependent_service.rb +++ b/app/services/projects/copy/overview_dependent_service.rb @@ -29,7 +29,7 @@ module Projects::Copy class OverviewDependentService < Dependency def self.human_name - I18n.t(:'overviews.label') + I18n.t(:'projects.copy.overviews') end protected diff --git a/app/services/projects/copy/queries_dependent_service.rb b/app/services/projects/copy/queries_dependent_service.rb index ca1f180f5e..853fe85a62 100644 --- a/app/services/projects/copy/queries_dependent_service.rb +++ b/app/services/projects/copy/queries_dependent_service.rb @@ -29,7 +29,7 @@ module Projects::Copy class QueriesDependentService < Dependency def self.human_name - I18n.t(:label_query_plural) + I18n.t(:'projects.copy.queries') end def source_count diff --git a/app/services/projects/copy/wiki_page_attachments_dependent_service.rb b/app/services/projects/copy/wiki_page_attachments_dependent_service.rb index d4f18c75bd..c82db19a50 100644 --- a/app/services/projects/copy/wiki_page_attachments_dependent_service.rb +++ b/app/services/projects/copy/wiki_page_attachments_dependent_service.rb @@ -31,7 +31,7 @@ module Projects::Copy include ::Copy::Concerns::CopyAttachments def self.human_name - I18n.t(:label_wiki_page_attachments) + I18n.t(:'projects.copy.wiki_page_attachments') end def source_count diff --git a/app/services/projects/copy/work_package_attachments_dependent_service.rb b/app/services/projects/copy/work_package_attachments_dependent_service.rb index 15379744ee..9aaf7672f9 100644 --- a/app/services/projects/copy/work_package_attachments_dependent_service.rb +++ b/app/services/projects/copy/work_package_attachments_dependent_service.rb @@ -31,7 +31,7 @@ module Projects::Copy include ::Copy::Concerns::CopyAttachments def self.human_name - I18n.t(:label_work_package_attachments) + I18n.t(:'projects.copy.work_package_attachments') end def source_count diff --git a/config/locales/en.yml b/config/locales/en.yml index a98ce60457..bb315092aa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -238,6 +238,15 @@ en: Enter one filename per line. projects: + copy: + # Contains custom strings for options when copying a project that cannot be found elsewhere. + members: 'Project members' + overviews: 'Project overview' + queries: 'Work packages: saved views' + wiki_page_attachments: 'Wiki pages: attachments' + work_package_attachments: 'Work packages: attachments' + work_package_categories: 'Work packages: categories' + work_package_file_links: 'Work packages: file links' delete: scheduled: "Deletion has been scheduled and is performed in the background. You will be notified of the result." schedule_failed: "Project cannot be deleted: %{errors}" @@ -1999,7 +2008,6 @@ en: label_wiki_start: "Start page" label_work_package: "Work package" label_work_package_attachments: "Work package attachments" - label_work_package_file_link_plural: "Work package file links" label_work_package_category_new: "New category" label_work_package_category_plural: "Work package categories" label_work_package_hierarchy: "Work package hierarchy" diff --git a/modules/storages/app/services/projects/copy/file_links_dependent_service.rb b/modules/storages/app/services/projects/copy/file_links_dependent_service.rb index 976cb97412..4d763ddf2b 100644 --- a/modules/storages/app/services/projects/copy/file_links_dependent_service.rb +++ b/modules/storages/app/services/projects/copy/file_links_dependent_service.rb @@ -29,7 +29,7 @@ module Projects::Copy class FileLinksDependentService < ::Copy::Dependency def self.human_name - I18n.t(:label_work_package_file_link_plural) + I18n.t(:'projects.copy.work_package_file_links') end def source_count diff --git a/spec/features/projects/template_spec.rb b/spec/features/projects/template_spec.rb index c63f18e5ef..f249dd0ab4 100644 --- a/spec/features/projects/template_spec.rb +++ b/spec/features/projects/template_spec.rb @@ -124,7 +124,7 @@ describe 'Project templates', type: :feature, js: true do expect(page).to have_selector('[data-qa-field-name="sendNotifications"]') # And allows to deselect copying the members. - uncheck 'Members' + uncheck I18n.t(:'projects.copy.members') page.find('button:not([disabled])', text: 'Save').click