Commit 5cfd059b authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 767f2961 7e2c80b5
...@@ -118,7 +118,7 @@ export default class CreateMergeRequestDropdown { ...@@ -118,7 +118,7 @@ export default class CreateMergeRequestDropdown {
this.branchCreated = true; this.branchCreated = true;
window.location.href = data.url; 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() { createMergeRequest() {
...@@ -130,7 +130,7 @@ export default class CreateMergeRequestDropdown { ...@@ -130,7 +130,7 @@ export default class CreateMergeRequestDropdown {
this.mergeRequestCreated = true; this.mergeRequestCreated = true;
window.location.href = data.url; 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() { disable() {
...@@ -227,7 +227,7 @@ export default class CreateMergeRequestDropdown { ...@@ -227,7 +227,7 @@ export default class CreateMergeRequestDropdown {
.catch(() => { .catch(() => {
this.unavailable(); this.unavailable();
this.disable(); this.disable();
new Flash('Failed to get ref.'); new Flash(__('Failed to get ref.'));
this.isGettingRef = false; this.isGettingRef = false;
......
...@@ -4,6 +4,7 @@ import _ from 'underscore'; ...@@ -4,6 +4,7 @@ import _ from 'underscore';
import './behaviors/preview_markdown'; import './behaviors/preview_markdown';
import csrf from './lib/utils/csrf'; import csrf from './lib/utils/csrf';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import { n__, __ } from '~/locale';
Dropzone.autoDiscover = false; Dropzone.autoDiscover = false;
...@@ -90,7 +91,7 @@ export default function dropzoneInput(form) { ...@@ -90,7 +91,7 @@ export default function dropzoneInput(form) {
if (!processingFileCount) $attachButton.removeClass('hide'); if (!processingFileCount) $attachButton.removeClass('hide');
addFileToForm(response.link.url); 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 '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 '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 // If the 'error' event is fired by backend (xhr) error response, the third parameter is
...@@ -273,19 +274,11 @@ export default function dropzoneInput(form) { ...@@ -273,19 +274,11 @@ export default function dropzoneInput(form) {
}; };
updateAttachingMessage = (files, messageContainer) => { updateAttachingMessage = (files, messageContainer) => {
let attachingMessage;
const filesCount = files.filter(file => file.status === 'uploading' || file.status === 'queued') const filesCount = files.filter(file => file.status === 'uploading' || file.status === 'queued')
.length; .length;
const attachingMessage = n__('Attaching a file', 'Attaching %d files', filesCount);
// Dinamycally change uploading files text depending on files number in messageContainer.text(`${attachingMessage} -`);
// dropzone files queue.
if (filesCount > 1) {
attachingMessage = `Attaching ${filesCount} files -`;
} else {
attachingMessage = 'Attaching a file -';
}
messageContainer.text(attachingMessage);
}; };
form.find('.markdown-selector').click(function onMarkdownClick(e) { form.find('.markdown-selector').click(function onMarkdownClick(e) {
......
import { __ } from '~/locale';
export const namespaceSelectOptions = state => { export const namespaceSelectOptions = state => {
const serializedNamespaces = state.namespaces.map(({ fullPath }) => ({ const serializedNamespaces = state.namespaces.map(({ fullPath }) => ({
id: fullPath, id: fullPath,
...@@ -5,9 +7,9 @@ export const namespaceSelectOptions = state => { ...@@ -5,9 +7,9 @@ export const namespaceSelectOptions = state => {
})); }));
return [ return [
{ text: 'Groups', children: serializedNamespaces }, { text: __('Groups'), children: serializedNamespaces },
{ {
text: 'Users', text: __('Users'),
children: [{ id: state.defaultTargetNamespace, text: state.defaultTargetNamespace }], children: [{ id: state.defaultTargetNamespace, text: state.defaultTargetNamespace }],
}, },
]; ];
......
...@@ -5102,6 +5102,12 @@ msgstr "" ...@@ -5102,6 +5102,12 @@ msgstr ""
msgid "Failed to connect to the prometheus server" msgid "Failed to connect to the prometheus server"
msgstr "" 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" msgid "Failed to create repository via gitlab-shell"
msgstr "" msgstr ""
...@@ -5111,6 +5117,9 @@ msgstr "" ...@@ -5111,6 +5117,9 @@ msgstr ""
msgid "Failed to deploy to" msgid "Failed to deploy to"
msgstr "" msgstr ""
msgid "Failed to get ref."
msgstr ""
msgid "Failed to install." msgid "Failed to install."
msgstr "" msgstr ""
......
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