Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

More i18n string changes

Klaus Zanders72809b1b7da2
diff --git a/app/components/members/user_filter_component.rb b/app/components/members/user_filter_component.rb
index 43180102d97..0ef24a8de7f 100644
--- a/app/components/members/user_filter_component.rb
+++ b/app/components/members/user_filter_component.rb
@@ -103,11 +103,11 @@ module Members
def mapped_shared_role_name(role)
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- I18n.t("work_package.sharing.permissions.view")
+ I18n.t("work_package.permissions.view")
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- I18n.t("work_package.sharing.permissions.comment")
+ I18n.t("work_package.permissions.comment")
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- I18n.t("work_package.sharing.permissions.edit")
+ I18n.t("work_package.permissions.edit")
else
role.name
end
diff --git a/app/components/shares/user_details_component.html.erb b/app/components/shares/user_details_component.html.erb
index f9c64eaacb7..2af0f5a1929 100644
--- a/app/components/shares/user_details_component.html.erb
+++ b/app/components/shares/user_details_component.html.erb
@@ -25,7 +25,7 @@
concat(render(Primer::Beta::Text.new(color: :subtle)) { I18n.t('sharing.user_details.invited') })
concat(
form_with(url: resend_invite_path, method: :post) do
- render(Primer::Beta::Button.new(type: :submit, px: 0, scheme: :link)) { I18n.t('work_package.sharing.user_details.resend_invite') }
+ render(Primer::Beta::Button.new(type: :submit, px: 0, scheme: :link)) { I18n.t('sharing.user_details.resend_invite') }
end
)
end
diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb
index 34fd4094c55..7a15f180e95 100644
--- a/app/controllers/shares_controller.rb
+++ b/app/controllers/shares_controller.rb
@@ -57,7 +57,7 @@ class SharesController < ApplicationController
find_or_create_users(send_notification: false) do |member_params|
user = User.find_by(id: member_params[:user_id])
if user.present? && user.locked?
- @errors.add(:base, I18n.t("work_package.sharing.warning_locked_user", user: user.name))
+ @errors.add(:base, I18n.t("sharing.warning_locked_user", user: user.name))
else
service_call = create_or_update_share(member_params[:user_id], [params[:member][:role_id]])
overall_result.push(service_call)
@@ -320,13 +320,13 @@ class SharesController < ApplicationController
[
{ label: I18n.t("work_package.permissions.edit"),
value: role_mapping[Role::BUILTIN_WORK_PACKAGE_EDITOR],
- description: I18n.t("work_package.sharing.permissions.edit_description") },
+ description: I18n.t("work_package.permissions.edit_description") },
{ label: I18n.t("work_package.permissions.comment"),
value: role_mapping[Role::BUILTIN_WORK_PACKAGE_COMMENTER],
description: I18n.t("work_package.permissions.comment_description") },
- { label: I18n.t("work_package.sharing.permissions.view"),
+ { label: I18n.t("work_package.permissions.view"),
value: role_mapping[Role::BUILTIN_WORK_PACKAGE_VIEWER],
- description: I18n.t("work_package.sharing.permissions.view_description"),
+ description: I18n.t("work_package.permissions.view_description"),
default: true }
]
else
diff --git a/app/forms/shares/invitee.rb b/app/forms/shares/invitee.rb
index 419c7f5d71b..e6857c141cd 100644
--- a/app/forms/shares/invitee.rb
+++ b/app/forms/shares/invitee.rb
@@ -30,14 +30,14 @@ module Shares
form do |user_invite_form|
user_invite_form.autocompleter(
name: :user_id,
- label: I18n.t("work_package.sharing.label_search"),
+ label: I18n.t("sharing.label_search"),
visually_hide_label: true,
data: { "shares--user-limit-target": "autocompleter" },
autocomplete_options: {
component: "opce-user-autocompleter",
defaultData: false,
id: "op-share-dialog-invite-autocomplete",
- placeholder: I18n.t("work_package.sharing.label_search_placeholder"),
+ placeholder: I18n.t("sharing.label_search_placeholder"),
data: {
"test-selector": "op-share-dialog-invite-autocomplete"
},
diff --git a/app/mailers/sharing_mailer.rb b/app/mailers/sharing_mailer.rb
index d01efe5a916..db6e63fa297 100644
--- a/app/mailers/sharing_mailer.rb
+++ b/app/mailers/sharing_mailer.rb
@@ -39,11 +39,11 @@ class SharingMailer < ApplicationMailer
def derive_role_rights(role)
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- I18n.t("work_package.sharing.permissions.edit")
+ I18n.t("work_package.permissions.edit")
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- I18n.t("work_package.sharing.permissions.comment")
+ I18n.t("work_package.permissions.comment")
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- I18n.t("work_package.sharing.permissions.view")
+ I18n.t("work_package.permissions.view")
end
end
@@ -51,14 +51,14 @@ class SharingMailer < ApplicationMailer
allowed_actions =
case role.builtin
when Role::BUILTIN_WORK_PACKAGE_EDITOR
- [I18n.t("work_package.sharing.permissions.view"),
- I18n.t("work_package.sharing.permissions.comment"),
- I18n.t("work_package.sharing.permissions.edit")]
+ [I18n.t("work_package.permissions.view"),
+ I18n.t("work_package.permissions.comment"),
+ I18n.t("work_package.permissions.edit")]
when Role::BUILTIN_WORK_PACKAGE_COMMENTER
- [I18n.t("work_package.sharing.permissions.view"),
- I18n.t("work_package.sharing.permissions.comment")]
+ [I18n.t("work_package.permissions.view"),
+ I18n.t("work_package.permissions.comment")]
when Role::BUILTIN_WORK_PACKAGE_VIEWER
- [I18n.t("work_package.sharing.permissions.view")]
+ [I18n.t("work_package.permissions.view")]
end
allowed_actions.map(&:downcase)
diff --git a/spec/features/work_packages/share/filter_spec.rb b/spec/features/work_packages/share/filter_spec.rb
index c6e7e81e6a1..993db90e1c3 100644
--- a/spec/features/work_packages/share/filter_spec.rb
+++ b/spec/features/work_packages/share/filter_spec.rb
@@ -86,7 +86,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_shared_count_of(6)
# Filter for: project members (users only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.project_member"))
+ share_modal.filter("type", I18n.t("sharing.filter.project_member"))
share_modal.expect_shared_count_of(3)
share_modal.expect_shared_with(project_user, "View")
@@ -98,7 +98,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_non_project_group)
# Filter for: non-project members (users only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_member"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_member"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(non_project_user, "Edit")
@@ -109,7 +109,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_non_project_group)
# Filter for: project members (groups only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.project_group"))
+ share_modal.filter("type", I18n.t("sharing.filter.project_group"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(shared_project_group, "Edit")
@@ -120,7 +120,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_non_project_group)
# Filter for: non-project members (groups only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_group"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_group"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(shared_non_project_group, "View")
@@ -131,7 +131,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_project_group)
# Clicking again on the filter will reset it
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_group"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_group"))
share_modal.expect_shared_count_of(6)
share_modal.expect_shared_with(project_user, "View")
@@ -147,7 +147,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_shared_count_of(6)
# Filter for: all principals with Edit permission
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.edit"))
+ share_modal.filter("role", I18n.t("sharing.permissions.edit"))
share_modal.expect_shared_count_of(3)
share_modal.expect_shared_with(inherited_project_user, "Edit")
@@ -158,7 +158,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_non_project_group)
# Filter for: all principals with View permission
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.view"))
+ share_modal.filter("role", I18n.t("sharing.permissions.view"))
share_modal.expect_shared_count_of(2)
share_modal.expect_shared_with(project_user, "View")
@@ -169,7 +169,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_project_group)
# Filter for: all principals with Comment permission
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.comment"))
+ share_modal.filter("role", I18n.t("sharing.permissions.comment"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(project_user2, "Comment")
@@ -180,7 +180,7 @@ RSpec.describe "Work package sharing",
share_modal.expect_not_shared_with(shared_non_project_group)
# Clicking again on the filter will reset it
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.comment"))
+ share_modal.filter("role", I18n.t("sharing.permissions.comment"))
share_modal.expect_shared_count_of(6)
share_modal.expect_shared_with(project_user, "View")
@@ -198,7 +198,7 @@ RSpec.describe "Work package sharing",
# Filter for: all principals with View permission
# role: view
# type: none
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.view"))
+ share_modal.filter("role", I18n.t("sharing.permissions.view"))
share_modal.expect_shared_count_of(2)
share_modal.expect_shared_with(project_user, "View")
@@ -211,7 +211,7 @@ RSpec.describe "Work package sharing",
# Additional filter for: project members (users only)
# role: view
# type: project members (users only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.project_member"))
+ share_modal.filter("type", I18n.t("sharing.filter.project_member"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(project_user, "View")
@@ -224,7 +224,7 @@ RSpec.describe "Work package sharing",
# Change type filter to: project members (groups only)
# role: view
# type: non-project members (groups only)
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_group"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_group"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(shared_non_project_group, "View")
@@ -237,7 +237,7 @@ RSpec.describe "Work package sharing",
# Reset role filter
# role: none
# type: non-project members (groups only)
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.view"))
+ share_modal.filter("role", I18n.t("sharing.permissions.view"))
share_modal.expect_shared_count_of(1)
share_modal.expect_shared_with(shared_non_project_group, "View")
@@ -250,7 +250,7 @@ RSpec.describe "Work package sharing",
# Reset type filter
# role: none
# type: none
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_group"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_group"))
share_modal.expect_shared_count_of(6)
share_modal.expect_shared_with(project_user, "View")
@@ -264,8 +264,8 @@ RSpec.describe "Work package sharing",
context "and there are no matching results for my filter" do
it 'does not check the "toggle all" checkbox' do
share_modal.expect_open
- share_modal.filter("type", I18n.t("work_package.sharing.filter.not_project_member"))
- share_modal.filter("role", I18n.t("work_package.sharing.permissions.view"))
+ share_modal.filter("type", I18n.t("sharing.filter.not_project_member"))
+ share_modal.filter("role", I18n.t("sharing.permissions.view"))
share_modal.expect_empty_search_blankslate
share_modal.expect_shared_count_of(0)
diff --git a/spec/features/work_packages/share/share_spec.rb b/spec/features/work_packages/share/share_spec.rb
index 33d4fbc47b7..2151b4fad21 100644
--- a/spec/features/work_packages/share/share_spec.rb
+++ b/spec/features/work_packages/share/share_spec.rb
@@ -450,7 +450,7 @@ RSpec.describe "Work package sharing",
# The number of shared people has not changed, but an error message is shown
share_modal.expect_shared_count_of(6)
- share_modal.expect_error_message(I18n.t("work_package.sharing.warning_locked_user", user: locked_user.name))
+ share_modal.expect_error_message(I18n.t("sharing.warning_locked_user", user: locked_user.name))
end
end
diff --git a/spec/support/components/work_packages/share_modal.rb b/spec/support/components/work_packages/share_modal.rb
index 566d22724a3..023e237eca7 100644
--- a/spec/support/components/work_packages/share_modal.rb
+++ b/spec/support/components/work_packages/share_modal.rb
@@ -190,13 +190,13 @@ module Components
def expect_blankslate
within_modal do
- expect(page).to have_text(I18n.t("work_package.sharing.text_empty_state_description"))
+ expect(page).to have_text(I18n.t("sharing.text_empty_state_description"))
end
end
def expect_empty_search_blankslate
within_modal do
- expect(page).to have_text(I18n.t("work_package.sharing.text_empty_search_description"))
+ expect(page).to have_text(I18n.t("sharing.text_empty_search_description"))
end
end
@@ -318,26 +318,26 @@ module Components
def expect_shared_count_of(count)
expect(shares_header)
- .to have_text(I18n.t("work_package.sharing.count", count:))
+ .to have_text(I18n.t("sharing.count", count:))
end
def expect_no_invite_option
within_modal do
expect(page)
- .to have_text(I18n.t("work_package.sharing.permissions.denied"))
+ .to have_text(I18n.t("sharing.permissions.denied"))
end
end
def resend_invite(user)
within user_row(user) do
- click_button I18n.t("work_package.sharing.user_details.resend_invite")
+ click_button I18n.t("sharing.user_details.resend_invite")
end
end
def expect_invite_resent(user)
within user_row(user) do
expect(page)
- .to have_text(I18n.t("work_package.sharing.user_details.invite_resent"))
+ .to have_text(I18n.t("sharing.user_details.invite_resent"))
end
end
@@ -388,14 +388,14 @@ module Components
def expect_no_user_limit_warning
within modal_element do
expect(page)
- .to have_no_text(I18n.t("work_package.sharing.warning_user_limit_reached"), wait: 0)
+ .to have_no_text(I18n.t("sharing.warning_user_limit_reached", entity: WorkPackage.model_name.human), wait: 0)
end
end
def expect_user_limit_warning
within modal_element do
expect(page)
- .to have_text(I18n.t("work_package.sharing.warning_user_limit_reached"))
+ .to have_text(I18n.t("sharing.warning_user_limit_reached", entity: WorkPackage.model_name.human))
end
end
@@ -410,14 +410,14 @@ module Components
def expect_select_a_user_hint
within modal_element do
expect(page)
- .to have_text(I18n.t("work_package.sharing.warning_no_selected_user"))
+ .to have_text(I18n.t("sharing.warning_no_selected_user", entity: WorkPackage.model_name.human))
end
end
def expect_no_select_a_user_hint
within modal_element do
expect(page)
- .to have_no_text(I18n.t("work_package.sharing.warning_no_selected_user"), wait: 0)
+ .to have_no_text(I18n.t("sharing.warning_no_selected_user", entity: WorkPackage.model_name.human), wait: 0)
end
end
end