Skip to content

Commit e2d88aa

Browse files
authored
[OP-9533] Translation error in "add work package" macro in WYSWIG (#24750)
* Use + type instead of a translation key * Update specs
1 parent e796e80 commit e2d88aa

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

config/locales/en.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3941,7 +3941,6 @@ en:
39413941
invalid_type: "No type found with name '%{type}' in project '%{project}'."
39423942
no_project_context: "Calling create_work_package_link macro from outside project context."
39433943
link_name: "New work package"
3944-
link_name_type: "New %{type_name}"
39453944
errors:
39463945
missing_or_invalid_parameter: "Missing or invalid macro parameter."
39473946
include_wiki_page:

lib/open_project/text_formatting/filters/macros/create_work_package_link.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def work_package_link(macro, context) # rubocop:disable Metrics/AbcSize
6464
end
6565

6666
ApplicationController.helpers.link_to(
67-
I18n.t("macros.create_work_package_link.link_name_type", type_name:),
67+
"+ #{type_name}",
6868
new_project_work_packages_path(project_id: project.identifier, type: type.id),
6969
class: class_name
7070
)

spec/lib/open_project/text_formatting/markdown/work_package_buttons_macro_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def error_html(exception_msg)
108108
let(:expected) do
109109
<<~EXPECTED
110110
<p class="op-uc-p">
111-
<a class="op-uc-link" target="_top" href="/projects/my-project/work_packages/new?type=#{type.id}">New MyTaskName</a>
111+
<a class="op-uc-link" target="_top" href="/projects/my-project/work_packages/new?type=#{type.id}">+ MyTaskName</a>
112112
</p>
113113
EXPECTED
114114
end
@@ -125,7 +125,7 @@ def error_html(exception_msg)
125125
let(:expected) do
126126
<<~EXPECTED
127127
<p class="op-uc-p">
128-
<a class="button op-uc-link" target="_top" href="/projects/my-project/work_packages/new?type=#{type.id}">New MyTaskName</a>
128+
<a class="button op-uc-link" target="_top" href="/projects/my-project/work_packages/new?type=#{type.id}">+ MyTaskName</a>
129129
</p>
130130
EXPECTED
131131
end

0 commit comments

Comments
 (0)