Commit 965100a3 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Add missing sprintf and remove bad i18n

An instance of i18n which required sprintf was not handled correctly
and has been fixed in this commit.

Further to this, i18n was applied to
  app/assets/javascripts/new_branch_form.js
but needed to be removed as the i18n was too vague.

A note has been made to follow up on this file.
parent 2d612aaa
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import $ from 'jquery'; import $ from 'jquery';
import RefSelectDropdown from './ref_select_dropdown'; import RefSelectDropdown from './ref_select_dropdown';
import { s__ } from './locale';
export default class NewBranchForm { export default class NewBranchForm {
constructor(form, availableRefs) { constructor(form, availableRefs) {
...@@ -30,23 +29,23 @@ export default class NewBranchForm { ...@@ -30,23 +29,23 @@ export default class NewBranchForm {
var endsWith, invalid, single, startsWith; var endsWith, invalid, single, startsWith;
startsWith = { startsWith = {
pattern: /^(\/|\.)/g, pattern: /^(\/|\.)/g,
prefix: s__("BranchValidation|can't start with"), prefix: "can't start with",
conjunction: s__('BranchValidation|or'), conjunction: 'or',
}; };
endsWith = { endsWith = {
pattern: /(\/|\.|\.lock)$/g, pattern: /(\/|\.|\.lock)$/g,
prefix: s__("BranchValidation|can't end in"), prefix: "can't end in",
conjunction: s__('BranchValidation|or'), conjunction: 'or',
}; };
invalid = { invalid = {
pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g, pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g,
prefix: s__("BranchValidation|can't contain"), prefix: "can't contain",
conjunction: ', ', conjunction: ', ',
}; };
single = { single = {
pattern: /^@+$/g, pattern: /^@+$/g,
prefix: s__("BranchValidation|can't be"), prefix: "can't be",
conjunction: s__('BranchValidation|or'), conjunction: 'or',
}; };
return (this.restrictions = [startsWith, invalid, endsWith, single]); return (this.restrictions = [startsWith, invalid, endsWith, single]);
} }
...@@ -67,9 +66,9 @@ export default class NewBranchForm { ...@@ -67,9 +66,9 @@ export default class NewBranchForm {
formatted = values.map(function(value) { formatted = values.map(function(value) {
switch (false) { switch (false) {
case !/\s/.test(value): case !/\s/.test(value):
return s__('BranchValidation|spaces'); return 'spaces';
case !/\/{2,}/g.test(value): case !/\/{2,}/g.test(value):
return s__('BranchValidation|consecutive slashes'); return 'consecutive slashes';
default: default:
return "'" + value + "'"; return "'" + value + "'";
} }
......
...@@ -1504,7 +1504,9 @@ export default class Notes { ...@@ -1504,7 +1504,9 @@ export default class Notes {
tempFormContent = __('Applying multiple commands'); tempFormContent = __('Applying multiple commands');
} else { } else {
const commandDescription = executedCommands[0].description.toLowerCase(); const commandDescription = executedCommands[0].description.toLowerCase();
tempFormContent = __(`Applying command to ${commandDescription}`); tempFormContent = sprintf(__('Applying command to %{commandDescription}'), {
commandDescription,
});
} }
} else { } else {
tempFormContent = __('Applying command'); tempFormContent = __('Applying command');
......
...@@ -1462,27 +1462,6 @@ msgstr "" ...@@ -1462,27 +1462,6 @@ msgstr ""
msgid "BranchSwitcherTitle|Switch branch" msgid "BranchSwitcherTitle|Switch branch"
msgstr "" msgstr ""
msgid "BranchValidation|can't be"
msgstr ""
msgid "BranchValidation|can't contain"
msgstr ""
msgid "BranchValidation|can't end in"
msgstr ""
msgid "BranchValidation|can't start with"
msgstr ""
msgid "BranchValidation|consecutive slashes"
msgstr ""
msgid "BranchValidation|or"
msgstr ""
msgid "BranchValidation|spaces"
msgstr ""
msgid "Branches" msgid "Branches"
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