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.
This commit is contained in:
parent
3b5ce6945d
commit
a9ebcfa5f5
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue