diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2019-05-16 00:24:10 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-05-16 00:24:10 +0000 |
commit | 5f25dab667454f9f250cbaa7785fa88bd12ff45e (patch) | |
tree | 3323691fd71c7c4fc8cdf31545200aa7d7373904 | |
parent | 3b21139186b871e421f7a329b4761085eba75710 (diff) | |
parent | 965100a31065d8a9f097e568674f7e22f680e6ff (diff) | |
download | gitlab-ce-5f25dab667454f9f250cbaa7785fa88bd12ff45e.tar.gz |
Merge branch 'js-i18n-n' into 'master'
i18n JS files starting with n
See merge request gitlab-org/gitlab-ce!28132
-rw-r--r-- | app/assets/javascripts/namespace_select.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js | 42 | ||||
-rw-r--r-- | locale/gitlab.pot | 24 |
3 files changed, 54 insertions, 15 deletions
diff --git a/app/assets/javascripts/namespace_select.js b/app/assets/javascripts/namespace_select.js index ee1a5274ff7..03d349ac714 100644 --- a/app/assets/javascripts/namespace_select.js +++ b/app/assets/javascripts/namespace_select.js @@ -4,6 +4,7 @@ import $ from 'jquery'; import Api from './api'; import { mergeUrlParams } from './lib/utils/url_utility'; import { parseBoolean } from '~/lib/utils/common_utils'; +import { __ } from './locale'; export default class NamespaceSelect { constructor(opts) { @@ -29,7 +30,7 @@ export default class NamespaceSelect { return Api.namespaces(term, function(namespaces) { if (isFilter) { const anyNamespace = { - text: 'Any namespace', + text: __('Any namespace'), id: null, }; namespaces.unshift(anyNamespace); diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 36725e22365..d03f4508fb8 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -35,6 +35,7 @@ import { } from './lib/utils/common_utils'; import imageDiffHelper from './image_diff/helpers/index'; import { localTimeAgo } from './lib/utils/datetime_utility'; +import { sprintf, s__, __ } from './locale'; window.autosize = Autosize; @@ -253,7 +254,7 @@ export default class Notes { discussionNoteForm = $textarea.closest('.js-discussion-note-form'); if (discussionNoteForm.length) { if ($textarea.val() !== '') { - if (!window.confirm('Are you sure you want to cancel creating this comment?')) { + if (!window.confirm(__('Are you sure you want to cancel creating this comment?'))) { return; } } @@ -265,7 +266,7 @@ export default class Notes { originalText = $textarea.closest('form').data('originalNote'); newText = $textarea.val(); if (originalText !== newText) { - if (!window.confirm('Are you sure you want to cancel editing this comment?')) { + if (!window.confirm(__('Are you sure you want to cancel editing this comment?'))) { return; } } @@ -636,7 +637,7 @@ export default class Notes { this.glForm = new GLForm(form, enableGFM); textarea = form.find('.js-note-text'); key = [ - 'Note', + s__('NoteForm|Note'), form.find('#note_noteable_type').val(), form.find('#note_noteable_id').val(), form.find('#note_commit_id').val(), @@ -670,7 +671,9 @@ export default class Notes { formParentTimeline = $form.closest('.discussion-notes').find('.notes'); } return this.addFlash( - 'Your comment could not be submitted! Please check your network connection and try again.', + __( + 'Your comment could not be submitted! Please check your network connection and try again.', + ), 'alert', formParentTimeline.get(0), ); @@ -679,7 +682,7 @@ export default class Notes { updateNoteError($parentTimeline) { // eslint-disable-next-line no-new new Flash( - 'Your comment could not be updated! Please check your network connection and try again.', + __('Your comment could not be updated! Please check your network connection and try again.'), ); } @@ -1258,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')); } @@ -1491,13 +1501,15 @@ export default class Notes { if (executedCommands && executedCommands.length) { if (executedCommands.length > 1) { - tempFormContent = 'Applying multiple commands'; + tempFormContent = __('Applying multiple commands'); } else { const commandDescription = executedCommands[0].description.toLowerCase(); - tempFormContent = `Applying command to ${commandDescription}`; + tempFormContent = sprintf(__('Applying command to %{commandDescription}'), { + commandDescription, + }); } } else { - tempFormContent = 'Applying command'; + tempFormContent = __('Applying command'); } return tempFormContent; @@ -1817,7 +1829,9 @@ export default class Notes { $editingNote .find('.note-headline-meta a') .html( - '<i class="fa fa-spinner fa-spin" aria-label="Comment is being updated" aria-hidden="true"></i>', + `<i class="fa fa-spinner fa-spin" aria-label="${__( + 'Comment is being updated', + )}" aria-hidden="true"></i>`, ); // Make request to update comment on server diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fdb6adfbd51..f13c3023bab 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -982,6 +982,9 @@ msgstr "" msgid "Any encrypted tokens" msgstr "" +msgid "Any namespace" +msgstr "" + msgid "Appearance" msgstr "" @@ -1069,6 +1072,12 @@ msgstr "" msgid "Are you sure that you want to unarchive this project?" msgstr "" +msgid "Are you sure you want to cancel creating this comment?" +msgstr "" + +msgid "Are you sure you want to cancel editing this comment?" +msgstr "" + msgid "Are you sure you want to delete this list?" msgstr "" @@ -2587,6 +2596,9 @@ msgstr "" msgid "Comment form position" msgstr "" +msgid "Comment is being updated" +msgstr "" + msgid "Comments" msgstr "" @@ -6399,6 +6411,9 @@ msgstr "" msgid "Note: Consider asking your GitLab administrator to configure %{github_integration_link}, which will allow login via GitHub and allow importing repositories without generating a Personal Access Token." msgstr "" +msgid "NoteForm|Note" +msgstr "" + msgid "Notes|Are you sure you want to cancel creating this comment?" msgstr "" @@ -6414,6 +6429,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 "" @@ -11290,6 +11308,12 @@ msgstr "" msgid "Your changes have been successfully committed." msgstr "" +msgid "Your comment could not be submitted! Please check your network connection and try again." +msgstr "" + +msgid "Your comment could not be updated! Please check your network connection and try again." +msgstr "" + msgid "Your comment will not be visible to the public." msgstr "" |