Commit b6ff25c2 authored by Robert Hunt's avatar Robert Hunt

Improve approvals model translation strings by removing the string break

The existing approval model removal warning was breaking the translation
into two individual strings, this joins them back together to improve
overall translation accuracy

Changelog: changed
parent df540313
......@@ -10,9 +10,12 @@ const i18n = {
regularRule: {
primaryButtonText: __('Remove approvers'),
modalTitle: __('Remove approvers?'),
removeWarningText: s__(
'ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{nMembers}.',
),
removeWarningText: (i) =>
n__(
'ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} member%{strongEnd}. Approvals from this member are not revoked.',
'ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} members%{strongEnd}. Approvals from these members are not revoked.',
i,
),
},
externalRule: {
primaryButtonText: s__('ApprovalRuleRemove|Remove approval gate'),
......@@ -41,6 +44,9 @@ export default {
isExternalApprovalRule() {
return this.rule?.ruleType === RULE_TYPE_EXTERNAL_APPROVAL;
},
approversCount() {
return this.rule.approvers.length;
},
membersText() {
return n__(
'ApprovalRuleRemove|%d member',
......@@ -48,13 +54,6 @@ export default {
this.rule.approvers.length,
);
},
revokeWarningText() {
return n__(
'ApprovalRuleRemove|Approvals from this member are not revoked.',
'ApprovalRuleRemove|Approvals from these members are not revoked.',
this.rule.approvers.length,
);
},
modalTitle() {
return this.isExternalApprovalRule
? i18n.externalRule.modalTitle
......@@ -63,7 +62,7 @@ export default {
modalText() {
return this.isExternalApprovalRule
? i18n.externalRule.removeWarningText
: `${i18n.regularRule.removeWarningText} ${this.revokeWarningText}`;
: i18n.regularRule.removeWarningText(this.approversCount);
},
primaryButtonProps() {
const text = this.isExternalApprovalRule
......@@ -106,8 +105,12 @@ export default {
<template #name>
<strong>{{ rule.name }}</strong>
</template>
<template #nMembers>
<strong>{{ membersText }}</strong>
<template #strong="{ content }">
<strong>
<gl-sprintf :message="content">
<template #count>{{ approversCount }}</template>
</gl-sprintf>
</strong>
</template>
</gl-sprintf>
</p>
......
---
title: Improve approvals modal translation strings
merge_request: 60108
author:
type: changed
......@@ -4038,11 +4038,6 @@ msgid_plural "ApprovalRuleRemove|%d members"
msgstr[0] ""
msgstr[1] ""
msgid "ApprovalRuleRemove|Approvals from this member are not revoked."
msgid_plural "ApprovalRuleRemove|Approvals from these members are not revoked."
msgstr[0] ""
msgstr[1] ""
msgid "ApprovalRuleRemove|Remove approval gate"
msgstr ""
......@@ -4052,8 +4047,10 @@ msgstr ""
msgid "ApprovalRuleRemove|You are about to remove the %{name} approval gate. Approval from this service is not revoked."
msgstr ""
msgid "ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{nMembers}."
msgstr ""
msgid "ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} member%{strongEnd}. Approvals from this member are not revoked."
msgid_plural "ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} members%{strongEnd}. Approvals from these members are not revoked."
msgstr[0] ""
msgstr[1] ""
msgid "ApprovalRuleSummary|%d member"
msgid_plural "ApprovalRuleSummary|%d members"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment