Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/new_branch_form.js')
-rw-r--r--app/assets/javascripts/new_branch_form.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/javascripts/new_branch_form.js b/app/assets/javascripts/new_branch_form.js
index f338dbbb0a6..80115e75b58 100644
--- a/app/assets/javascripts/new_branch_form.js
+++ b/app/assets/javascripts/new_branch_form.js
@@ -2,6 +2,7 @@
import $ from 'jquery';
import RefSelectDropdown from './ref_select_dropdown';
+import { s__ } from './locale';
export default class NewBranchForm {
constructor(form, availableRefs) {
@@ -29,23 +30,23 @@ export default class NewBranchForm {
var endsWith, invalid, single, startsWith;
startsWith = {
pattern: /^(\/|\.)/g,
- prefix: "can't start with",
- conjunction: 'or',
+ prefix: s__("BranchValidation|can't start with"),
+ conjunction: s__('BranchValidation|or'),
};
endsWith = {
pattern: /(\/|\.|\.lock)$/g,
- prefix: "can't end in",
- conjunction: 'or',
+ prefix: s__("BranchValidation|can't end in"),
+ conjunction: s__('BranchValidation|or'),
};
invalid = {
pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g,
- prefix: "can't contain",
+ prefix: s__("BranchValidation|can't contain"),
conjunction: ', ',
};
single = {
pattern: /^@+$/g,
- prefix: "can't be",
- conjunction: 'or',
+ prefix: s__("BranchValidation|can't be"),
+ conjunction: s__('BranchValidation|or'),
};
return (this.restrictions = [startsWith, invalid, endsWith, single]);
}
@@ -66,9 +67,9 @@ export default class NewBranchForm {
formatted = values.map(function(value) {
switch (false) {
case !/\s/.test(value):
- return 'spaces';
+ return s__('BranchValidation|spaces');
case !/\/{2,}/g.test(value):
- return 'consecutive slashes';
+ return s__('BranchValidation|consecutive slashes');
default:
return "'" + value + "'";
}