From 0d88bd7c1ae95cf077c2fa231d942204ff3b8f68 Mon Sep 17 00:00:00 2001 From: OlegIvaniv Date: Wed, 24 May 2023 15:01:06 +0200 Subject: [PATCH] fix(editor): Fix locale plularisation if count is 0 (#6312) --- packages/editor-ui/src/components/ExecutionsUsage.vue | 2 +- packages/editor-ui/src/plugins/i18n/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/ExecutionsUsage.vue b/packages/editor-ui/src/components/ExecutionsUsage.vue index 41d9d84b1..523928672 100644 --- a/packages/editor-ui/src/components/ExecutionsUsage.vue +++ b/packages/editor-ui/src/components/ExecutionsUsage.vue @@ -16,7 +16,7 @@ {{ locale.baseText('executionUsage.currentUsage.count', { - adjustToNumber: daysLeftOnTrial, + adjustToNumber: daysLeftOnTrial || 0, }) }} diff --git a/packages/editor-ui/src/plugins/i18n/index.ts b/packages/editor-ui/src/plugins/i18n/index.ts index 31f5bf0ae..a8d76d43d 100644 --- a/packages/editor-ui/src/plugins/i18n/index.ts +++ b/packages/editor-ui/src/plugins/i18n/index.ts @@ -64,7 +64,7 @@ export class I18nClass { key: BaseTextKey, options?: { adjustToNumber?: number; interpolate?: { [key: string]: string } }, ): string { - if (options && options.adjustToNumber) { + if (options?.adjustToNumber !== undefined) { return this.i18n.tc(key, options.adjustToNumber, options && options.interpolate).toString(); }