summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-05-07 18:36:38 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-15 14:58:46 +0200
commita9ebcfa5f55fe8444d9c0058904a9f1dbee7e32e (patch)
tree4ee56df5c959962868bb39584d9e9016b1755090
parent3b5ce6945dee059717855962271245bbb29f24e1 (diff)
downloadgitlab-ce-a9ebcfa5f55fe8444d9c0058904a9f1dbee7e32e.tar.gz
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.
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue b/app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
index 2254271c679..d376a004e84 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
@@ -38,14 +38,17 @@ export default {
return this.modifiedFilesLength ? 'multi-file-modified' : '';
},
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(),
+ count: this.addedFilesLength,
});
},
modifiedTooltip() {
return sprintf(
- n__('1 %{type} modification', '%d %{type} modifications', this.modifiedFilesLength),
- { type: this.title.toLowerCase() },
+ n__('1 %{type} modification', '%{count} %{type} modifications', this.modifiedFilesLength), {
+ type: this.title.toLowerCase(),
+ count: this.modifiedFilesLength,
+ },
);
},
titleTooltip() {