Commit a9ebcfa5 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Interpolate named counts in JS

Even though JS does the `%d` interpolation in `n__` using a string
replacement. This would not be compatible with the ruby
implementation.

Therefore using named variables instead.
parent 3b5ce694
...@@ -38,14 +38,17 @@ export default { ...@@ -38,14 +38,17 @@ export default {
return this.modifiedFilesLength ? 'multi-file-modified' : ''; return this.modifiedFilesLength ? 'multi-file-modified' : '';
}, },
additionsTooltip() { additionsTooltip() {
return sprintf(n__('1 %{type} addition', '%d %{type} additions', this.addedFilesLength), { return sprintf(n__('1 %{type} addition', '%{count} %{type} additions', this.addedFilesLength), {
type: this.title.toLowerCase(), type: this.title.toLowerCase(),
count: this.addedFilesLength,
}); });
}, },
modifiedTooltip() { modifiedTooltip() {
return sprintf( return sprintf(
n__('1 %{type} modification', '%d %{type} modifications', this.modifiedFilesLength), n__('1 %{type} modification', '%{count} %{type} modifications', this.modifiedFilesLength), {
{ type: this.title.toLowerCase() }, type: this.title.toLowerCase(),
count: this.modifiedFilesLength,
},
); );
}, },
titleTooltip() { titleTooltip() {
......
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