Commit 83224950 authored by Constance Okoghenun's avatar Constance Okoghenun

Updated i18n for discussion note commit SHA

Ensured that sentence order is preserved when translating
parent 993616a6
...@@ -80,12 +80,27 @@ export default { ...@@ -80,12 +80,27 @@ export default {
isTarget() { isTarget() {
return this.targetNoteHash === this.noteAnchorId; return this.targetNoteHash === this.noteAnchorId;
}, },
truncatedHash() { actionText() {
if (!this.commit) { if (!this.commit) {
return ''; return '';
} }
return sprintf(s__('MergeRequests|%{commitSha}'), { commitSha: truncateSha(this.commit.id) }); // We need to do this to ensure we have the currect sentence order
// when translating this as the sentence order may change from one
// language to the next. See:
// https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24427#note_133713771
const { id, url } = this.commit;
const linkStart = `<a class="commit-sha monospace" href="${escape(url)}">`;
const linkEnd = '</a>';
return sprintf(
s__('MergeRequests|commented on commit %{linkStart}%{commitId}%{linkEnd}'),
{
commitId: truncateSha(id),
linkStart,
linkEnd,
},
false,
);
}, },
}, },
...@@ -215,10 +230,7 @@ export default { ...@@ -215,10 +230,7 @@ export default {
<div class="timeline-content"> <div class="timeline-content">
<div class="note-header"> <div class="note-header">
<note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id"> <note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id">
<span v-if="commit"> <span v-if="commit" v-html="actionText"></span>
{{ s__('MergeRequests|commented on commit ')
}}<a class="commit-sha monospace" :href="commit.url">{{ truncatedHash }}</a>
</span>
<span v-else class="d-none d-sm-inline">&middot;</span> <span v-else class="d-none d-sm-inline">&middot;</span>
</note-header> </note-header>
<note-actions <note-actions
......
...@@ -4279,9 +4279,6 @@ msgstr "" ...@@ -4279,9 +4279,6 @@ msgstr ""
msgid "Merge requests are a place to propose changes you've made to a project and discuss those changes with others" msgid "Merge requests are a place to propose changes you've made to a project and discuss those changes with others"
msgstr "" msgstr ""
msgid "MergeRequests|%{commitSha}"
msgstr ""
msgid "MergeRequests|Resolve this discussion in a new issue" msgid "MergeRequests|Resolve this discussion in a new issue"
msgstr "" msgstr ""
...@@ -4297,7 +4294,7 @@ msgstr "" ...@@ -4297,7 +4294,7 @@ msgstr ""
msgid "MergeRequests|View replaced file @ %{commitId}" msgid "MergeRequests|View replaced file @ %{commitId}"
msgstr "" msgstr ""
msgid "MergeRequests|commented on commit " msgid "MergeRequests|commented on commit %{linkStart}%{commitId}%{linkEnd}"
msgstr "" msgstr ""
msgid "MergeRequests|started a discussion" msgid "MergeRequests|started a discussion"
......
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