Skip to content

Commit

Permalink
remove double {{count}}
Browse files Browse the repository at this point in the history
  • Loading branch information
upalatucci committed Feb 20, 2024
1 parent 803919f commit eeb0490
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions i18n-scripts/set-english-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function updateFile(fileName) {
const keys = Object.keys(file);

let originalKey;
let wordWithNoCount

for (let i = 0; i < keys.length; i++) {
// translations
Expand All @@ -48,11 +49,14 @@ function updateFile(fileName) {
switch (determineRule(keys[i])) {
case 0:
[originalKey] = keys[i].split('_other');
updatedFile[keys[i]] = `{{count}} ${pluralize(originalKey)}`;

wordWithNoCount = originalKey.replace('{{count}}', '').trim()
updatedFile[keys[i]] = `{{count}} ${pluralize(wordWithNoCount)}`;
break;
case 1:
[originalKey] = keys[i].split('_one');
updatedFile[keys[i]] = `{{count}} ${originalKey}`;
wordWithNoCount = originalKey.replace('{{count}}', '').trim()
updatedFile[keys[i]] = `{{count}} ${pluralize.singular(wordWithNoCount)}`;
break;
case 2:
[originalKey] = keys[i].split('_other');
Expand Down
16 changes: 8 additions & 8 deletions locales/en/plugin__kubevirt-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"(requires login) and copy the download link URL of the KVM guest image (expires quickly)": "(requires login) and copy the download link URL of the KVM guest image (expires quickly)",
"{{ osName }} VirtualMachine can not be edited because it is provided by OpenShift Virtualization Operator.": "{{ osName }} VirtualMachine can not be edited because it is provided by OpenShift Virtualization Operator.",
"{{annotationsCount}} Annotations": "{{annotationsCount}} Annotations",
"{{count}} Affinity rules_one": "{{count}} {{count}} Affinity rules",
"{{count}} Affinity rules_other": "{{count}} {{count}} Affinity rules",
"{{count}} Annotations_one": "{{count}} {{count}} Annotations",
"{{count}} Annotations_other": "{{count}} {{count}} Annotations",
"{{count}} Toleration rules_one": "{{count}} {{count}} Toleration rules",
"{{count}} Toleration rules_other": "{{count}} {{count}} Toleration rules",
"{{count}} Tolerations rules_one": "{{count}} {{count}} Tolerations rules",
"{{count}} Tolerations rules_other": "{{count}} {{count}} Tolerations rules",
"{{count}} Affinity rules_one": "{{count}} Affinity rule",
"{{count}} Affinity rules_other": "{{count}} Affinity rules",
"{{count}} Annotations_one": "{{count}} Annotation",
"{{count}} Annotations_other": "{{count}} Annotations",
"{{count}} Toleration rules_one": "{{count}} Toleration rule",
"{{count}} Toleration rules_other": "{{count}} Toleration rules",
"{{count}} Tolerations rules_one": "{{count}} Tolerations rule",
"{{count}} Tolerations rules_other": "{{count}} Tolerations rules",
"{{cpu}} CPU | {{memory}} Memory": "{{cpu}} CPU | {{memory}} Memory",
"{{cpuCount}} CPU | {{memory}} Memory": "{{cpuCount}} CPU | {{memory}} Memory",
"{{cpus}} CPUs, {{memory}} Memory": "{{cpus}} CPUs, {{memory}} Memory",
Expand Down

0 comments on commit eeb0490

Please sign in to comment.