diff options
author | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-05-02 16:22:28 +0200 |
---|---|---|
committer | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-05-17 12:04:16 +0200 |
commit | fa7bf979dfbdf4c34717c7fddaf856405ea9e9ca (patch) | |
tree | 65b5863f7414958f99e1b4a6bd3103cae3d1e5e8 | |
parent | f2cb5220112f1f7fe4c29c4b07998f77a67291a2 (diff) | |
download | gitlab-ce-fa7bf979dfbdf4c34717c7fddaf856405ea9e9ca.tar.gz |
I18N of js files starting with c or d
This is one of many MRs opened in order to improve the overall
internationalisation of the GitLab codebase.
This commit only targets Vanilla JS files.
i18n documentation
https://docs.gitlab.com/ee/development/i18n/externalization.html
-rw-r--r-- | app/assets/javascripts/create_merge_request_dropdown.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/dropzone_input.js | 7 | ||||
-rw-r--r-- | locale/gitlab.pot | 18 |
3 files changed, 25 insertions, 6 deletions
diff --git a/app/assets/javascripts/create_merge_request_dropdown.js b/app/assets/javascripts/create_merge_request_dropdown.js index 02aa507ba03..8f5cece0788 100644 --- a/app/assets/javascripts/create_merge_request_dropdown.js +++ b/app/assets/javascripts/create_merge_request_dropdown.js @@ -118,7 +118,7 @@ export default class CreateMergeRequestDropdown { this.branchCreated = true; window.location.href = data.url; }) - .catch(() => Flash('Failed to create a branch for this issue. Please try again.')); + .catch(() => Flash(__('Failed to create a branch for this issue. Please try again.'))); } createMergeRequest() { @@ -130,7 +130,7 @@ export default class CreateMergeRequestDropdown { this.mergeRequestCreated = true; window.location.href = data.url; }) - .catch(() => Flash('Failed to create Merge Request. Please try again.')); + .catch(() => Flash(__('Failed to create Merge Request. Please try again.'))); } disable() { @@ -227,7 +227,7 @@ export default class CreateMergeRequestDropdown { .catch(() => { this.unavailable(); this.disable(); - new Flash('Failed to get ref.'); + new Flash(__('Failed to get ref.')); this.isGettingRef = false; diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 9987fbcb6a7..1b32443f1d8 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -4,6 +4,7 @@ import _ from 'underscore'; import './behaviors/preview_markdown'; import csrf from './lib/utils/csrf'; import axios from './lib/utils/axios_utils'; +import { sprintf, __ } from '~/locale'; Dropzone.autoDiscover = false; @@ -90,7 +91,7 @@ export default function dropzoneInput(form) { if (!processingFileCount) $attachButton.removeClass('hide'); addFileToForm(response.link.url); }, - error: (file, errorMessage = 'Attaching the file failed.', xhr) => { + error: (file, errorMessage = __('Attaching the file failed.'), xhr) => { // If 'error' event is fired by dropzone, the second parameter is error message. // If the 'errorMessage' parameter is empty, the default error message is set. // If the 'error' event is fired by backend (xhr) error response, the third parameter is @@ -280,9 +281,9 @@ export default function dropzoneInput(form) { // Dinamycally change uploading files text depending on files number in // dropzone files queue. if (filesCount > 1) { - attachingMessage = `Attaching ${filesCount} files -`; + attachingMessage = sprintf(__('Attaching %{filesCount} files -'), { filesCount }); } else { - attachingMessage = 'Attaching a file -'; + attachingMessage = __('Attaching a file -'); } messageContainer.text(attachingMessage); diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 5800aa9604b..b0e9a1ab8f6 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -1186,6 +1186,15 @@ msgstr "" msgid "Attach a file by drag & drop or %{upload_link}" msgstr "" +msgid "Attaching %{filesCount} files -" +msgstr "" + +msgid "Attaching a file -" +msgstr "" + +msgid "Attaching the file failed." +msgstr "" + msgid "Aug" msgstr "" @@ -4205,6 +4214,12 @@ msgstr "" msgid "Failed to connect to the prometheus server" msgstr "" +msgid "Failed to create Merge Request. Please try again." +msgstr "" + +msgid "Failed to create a branch for this issue. Please try again." +msgstr "" + msgid "Failed to create repository via gitlab-shell" msgstr "" @@ -4214,6 +4229,9 @@ msgstr "" msgid "Failed to deploy to" msgstr "" +msgid "Failed to get ref." +msgstr "" + msgid "Failed to install." msgstr "" |