Commit 16859d83 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Update EE strings to comply to new validation

Make sure the security report strings don't mix variable usage. This
is now validated.
parent c6befd86
...@@ -177,8 +177,8 @@ export default { ...@@ -177,8 +177,8 @@ export default {
}); });
} }
return sprintf( return sprintf(
n__('%{type} detected %d vulnerability', '%{type} detected %d vulnerabilities', issuesCount), n__('%{type} detected 1 vulnerability', '%{type} detected %{vulnerabilityCount} vulnerabilities', issuesCount),
{ type }, { type: type, vulnerabilityCount: issuesCount },
); );
}, },
translateText(type) { translateText(type) {
......
...@@ -268,11 +268,11 @@ export const textBuilder = ( ...@@ -268,11 +268,11 @@ export const textBuilder = (
if (newIssues > 0) { if (newIssues > 0) {
return sprintf( return sprintf(
n__( n__(
'%{type} detected %d vulnerability for the source branch only', '%{type} detected 1 vulnerability for the source branch only',
'%{type} detected %d vulnerabilities for the source branch only', '%{type} detected %{vulnerabilityCount} vulnerabilities for the source branch only',
newIssues, newIssues,
), ),
{ type }, { type: type, vulnerabilityCount: newIssues },
); );
} }
...@@ -287,11 +287,11 @@ export const textBuilder = ( ...@@ -287,11 +287,11 @@ export const textBuilder = (
if (newIssues > 0 && resolvedIssues === 0) { if (newIssues > 0 && resolvedIssues === 0) {
return sprintf( return sprintf(
n__( n__(
'%{type} detected %d new vulnerability', '%{type} detected 1 new vulnerability',
'%{type} detected %d new vulnerabilities', '%{type} detected %{vulnerabilityCount} new vulnerabilities',
newIssues, newIssues,
), ),
{ type }, { type: type, vulnerabilityCount: newIssues },
); );
} }
...@@ -299,24 +299,24 @@ export const textBuilder = ( ...@@ -299,24 +299,24 @@ export const textBuilder = (
if (newIssues > 0 && resolvedIssues > 0) { if (newIssues > 0 && resolvedIssues > 0) {
return `${sprintf( return `${sprintf(
n__( n__(
'%{type} detected %d new vulnerability', '%{type} detected 1 new vulnerability',
'%{type} detected %d new vulnerabilities', '%{type} detected %{vulnerabilityCount} new vulnerabilities',
newIssues, newIssues,
), ),
{ type }, { type: type, vulnerabilityCount: newIssues },
)} )}
${n__('and %d fixed vulnerability', 'and %d fixed vulnerabilities', resolvedIssues)}`; ${n__('and 1 fixed vulnerability', 'and %d fixed vulnerabilities', resolvedIssues)}`;
} }
// with only fixed issues // with only fixed issues
if (newIssues === 0 && resolvedIssues > 0) { if (newIssues === 0 && resolvedIssues > 0) {
return sprintf( return sprintf(
n__( n__(
'%{type} detected %d fixed vulnerability', '%{type} detected 1 fixed vulnerability',
'%{type} detected %d fixed vulnerabilities', '%{type} detected %{vulnerabilityCount} fixed vulnerabilities',
resolvedIssues, resolvedIssues,
), ),
{ type }, { type: type, vulnerabilityCount: resolvedIssues },
); );
} }
} }
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-13 10:31-0400\n" "POT-Creation-Date: 2018-06-19 13:14+0200\n"
"PO-Revision-Date: 2018-06-13 10:31-0400\n" "PO-Revision-Date: 2018-06-19 13:14+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -140,8 +140,8 @@ msgstr "" ...@@ -140,8 +140,8 @@ msgstr ""
msgid "%{title} changes" msgid "%{title} changes"
msgstr "" msgstr ""
msgid "%{type} detected %d vulnerability" msgid "%{type} detected 1 vulnerability"
msgid_plural "%{type} detected %d vulnerabilities" msgid_plural "%{type} detected %{vulnerabilityCount} vulnerabilities"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
...@@ -164,12 +164,12 @@ msgid "- show less" ...@@ -164,12 +164,12 @@ msgid "- show less"
msgstr "" msgstr ""
msgid "1 %{type} addition" msgid "1 %{type} addition"
msgid_plural "%d %{type} additions" msgid_plural "%{count} %{type} additions"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "1 %{type} modification" msgid "1 %{type} modification"
msgid_plural "%d %{type} modifications" msgid_plural "%{count} %{type} modifications"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
...@@ -1411,6 +1411,12 @@ msgstr "" ...@@ -1411,6 +1411,12 @@ msgstr ""
msgid "ClusterIntegration|Kubernetes clusters can be used to deploy applications and to provide Review Apps for this project" msgid "ClusterIntegration|Kubernetes clusters can be used to deploy applications and to provide Review Apps for this project"
msgstr "" msgstr ""
msgid "ClusterIntegration|Learn more about %{help_link_start_machine_type}machine types%{help_link_end} and %{help_link_start_pricing}pricing%{help_link_end}."
msgstr ""
msgid "ClusterIntegration|Learn more about %{help_link_start}zones%{help_link_end}."
msgstr ""
msgid "ClusterIntegration|Learn more about %{link_to_documentation}" msgid "ClusterIntegration|Learn more about %{link_to_documentation}"
msgstr "" msgstr ""
...@@ -1507,9 +1513,6 @@ msgstr "" ...@@ -1507,9 +1513,6 @@ msgstr ""
msgid "ClusterIntegration|See and edit the details for your Kubernetes cluster" msgid "ClusterIntegration|See and edit the details for your Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|See zones"
msgstr ""
msgid "ClusterIntegration|Select machine type" msgid "ClusterIntegration|Select machine type"
msgstr "" msgstr ""
...@@ -1826,6 +1829,9 @@ msgstr "" ...@@ -1826,6 +1829,9 @@ msgstr ""
msgid "Control the maximum concurrency of repository backfill for this secondary node" msgid "Control the maximum concurrency of repository backfill for this secondary node"
msgstr "" msgstr ""
msgid "Control the maximum concurrency of verification operations for this Geo node"
msgstr ""
msgid "Copy SSH public key to clipboard" msgid "Copy SSH public key to clipboard"
msgstr "" msgstr ""
...@@ -2368,9 +2374,6 @@ msgstr "" ...@@ -2368,9 +2374,6 @@ msgstr ""
msgid "Error Reporting and Logging" msgid "Error Reporting and Logging"
msgstr "" msgstr ""
msgid "Error checking branch data. Please try again."
msgstr ""
msgid "Error committing changes. Please try again." msgid "Error committing changes. Please try again."
msgstr "" msgstr ""
...@@ -2778,6 +2781,9 @@ msgstr "" ...@@ -2778,6 +2781,9 @@ msgstr ""
msgid "Geo|Shards to synchronize" msgid "Geo|Shards to synchronize"
msgstr "" msgstr ""
msgid "Geo|Verification capacity"
msgstr ""
msgid "Git repository URL" msgid "Git repository URL"
msgstr "" msgstr ""
...@@ -3032,6 +3038,15 @@ msgstr "" ...@@ -3032,6 +3038,15 @@ msgstr ""
msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>." msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>."
msgstr "" msgstr ""
msgid "ImageDiffViewer|2-up"
msgstr ""
msgid "ImageDiffViewer|Onion skin"
msgstr ""
msgid "ImageDiffViewer|Swipe"
msgstr ""
msgid "Import" msgid "Import"
msgstr "" msgstr ""
...@@ -3501,6 +3516,9 @@ msgstr "" ...@@ -3501,6 +3516,9 @@ msgstr ""
msgid "Months" msgid "Months"
msgstr "" msgstr ""
msgid "More actions"
msgstr ""
msgid "More info" msgid "More info"
msgstr "" msgstr ""
...@@ -4947,7 +4965,7 @@ msgstr "" ...@@ -4947,7 +4965,7 @@ msgstr ""
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
msgid "Stage all" msgid "Stage all changes"
msgstr "" msgstr ""
msgid "Stage changes" msgid "Stage changes"
...@@ -5628,7 +5646,7 @@ msgstr "" ...@@ -5628,7 +5646,7 @@ msgstr ""
msgid "Unresolve discussion" msgid "Unresolve discussion"
msgstr "" msgstr ""
msgid "Unstage all" msgid "Unstage all changes"
msgstr "" msgstr ""
msgid "Unstage changes" msgid "Unstage changes"
...@@ -5979,7 +5997,7 @@ msgstr "" ...@@ -5979,7 +5997,7 @@ msgstr ""
msgid "You are on a read-only GitLab instance." msgid "You are on a read-only GitLab instance."
msgstr "" msgstr ""
msgid "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the %{primary_node}." msgid "You are on a secondary, <b>read-only</b> Geo node. If you want to make changes, you must visit this page on the %{primary_node}."
msgstr "" msgstr ""
msgid "You can also create a project from the command line." msgid "You can also create a project from the command line."
...@@ -6111,7 +6129,7 @@ msgstr "" ...@@ -6111,7 +6129,7 @@ msgstr ""
msgid "among other things" msgid "among other things"
msgstr "" msgstr ""
msgid "and %d fixed vulnerability" msgid "and 1 fixed vulnerability"
msgid_plural "and %d fixed vulnerabilities" msgid_plural "and %d fixed vulnerabilities"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
......
...@@ -232,6 +232,9 @@ describe('security reports utils', () => { ...@@ -232,6 +232,9 @@ describe('security reports utils', () => {
expect(textBuilder('', { head: 'foo', base: 'foo' }, 1, 0, 0)).toEqual( expect(textBuilder('', { head: 'foo', base: 'foo' }, 1, 0, 0)).toEqual(
' detected 1 new vulnerability', ' detected 1 new vulnerability',
); );
expect(textBuilder('', { head: 'foo', base: 'foo' }, 2, 0, 0)).toEqual(
' detected 2 new vulnerabilities',
);
}); });
}); });
...@@ -240,6 +243,9 @@ describe('security reports utils', () => { ...@@ -240,6 +243,9 @@ describe('security reports utils', () => {
expect( expect(
textBuilder('', { head: 'foo', base: 'foo' }, 1, 1, 0).replace(/\n+\s+/m, ' '), textBuilder('', { head: 'foo', base: 'foo' }, 1, 1, 0).replace(/\n+\s+/m, ' '),
).toEqual(' detected 1 new vulnerability and 1 fixed vulnerability'); ).toEqual(' detected 1 new vulnerability and 1 fixed vulnerability');
expect(
textBuilder('', { head: 'foo', base: 'foo' }, 2, 2, 0).replace(/\n+\s+/m, ' '),
).toEqual(' detected 2 new vulnerabilities and 2 fixed vulnerabilities');
}); });
}); });
...@@ -248,6 +254,9 @@ describe('security reports utils', () => { ...@@ -248,6 +254,9 @@ describe('security reports utils', () => {
expect(textBuilder('', { head: 'foo', base: 'foo' }, 0, 1, 0)).toEqual( expect(textBuilder('', { head: 'foo', base: 'foo' }, 0, 1, 0)).toEqual(
' detected 1 fixed vulnerability', ' detected 1 fixed vulnerability',
); );
expect(textBuilder('', { head: 'foo', base: 'foo' }, 0, 2, 0)).toEqual(
' detected 2 fixed vulnerabilities',
);
}); });
}); });
}); });
......
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