diff options
author | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-05-15 15:35:09 +0200 |
---|---|---|
committer | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-05-15 15:35:09 +0200 |
commit | 2d612aaa43636f8b623695967d8be7a085b03e90 (patch) | |
tree | abd29f544c3b0f262c301ab8f413b04f5cdfca54 | |
parent | 3d0b6823ab63652acf9703560f6ad4b267b88034 (diff) | |
download | gitlab-ce-2d612aaa43636f8b623695967d8be7a085b03e90.tar.gz |
Refactor split link after i18n
-rw-r--r-- | app/assets/javascripts/notes.js | 19 | ||||
-rw-r--r-- | locale/gitlab.pot | 12 |
2 files changed, 16 insertions, 15 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index bc5c7d9f16b..d21982721ed 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -35,7 +35,7 @@ import { } from './lib/utils/common_utils'; import imageDiffHelper from './image_diff/helpers/index'; import { localTimeAgo } from './lib/utils/datetime_utility'; -import { s__, __ } from './locale'; +import { sprintf, s__, __ } from './locale'; window.autosize = Autosize; @@ -1261,12 +1261,19 @@ export default class Notes { putConflictEditWarningInPlace(noteEntity, $note) { if ($note.find('.js-conflict-edit-warning').length === 0) { + const open_link = `<a href="#note_${ + noteEntity.id + }" target="_blank" rel="noopener noreferrer">`; const $alert = $(`<div class="js-conflict-edit-warning alert alert-danger"> - ${__('This comment has changed since you started editing, please review the')} - <a href="#note_${noteEntity.id}" target="_blank" rel="noopener noreferrer"> - ${__('updated comment')} - </a> - ${__('to ensure information is not lost')} + ${sprintf( + s__( + 'Notes|This comment has changed since you started editing, please review the %{open_link}updated comment%{close_link} to ensure information is not lost', + ), + { + open_link, + close_link: '</a>', + }, + )} </div>`); $alert.insertAfter($note.find('.note-text')); } diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 172da881387..1e7e1fe362c 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -6450,6 +6450,9 @@ msgstr "" msgid "Notes|Show history only" msgstr "" +msgid "Notes|This comment has changed since you started editing, please review the %{open_link}updated comment%{close_link} to ensure information is not lost" +msgstr "" + msgid "Nothing to preview." msgstr "" @@ -9733,9 +9736,6 @@ msgstr "" msgid "This branch has changed since you started editing. Would you like to create a new branch?" msgstr "" -msgid "This comment has changed since you started editing, please review the" -msgstr "" - msgid "This commit is part of merge request %{link_to_merge_request}. Comments created here will be created in the context of that merge request." msgstr "" @@ -11923,18 +11923,12 @@ msgstr "" msgid "this document" msgstr "" -msgid "to ensure information is not lost" -msgstr "" - msgid "triggered" msgstr "" msgid "updated" msgstr "" -msgid "updated comment" -msgstr "" - msgid "username" msgstr "" |