fix(editor): Fix locale plularisation if count is 0 (#6312)

This commit is contained in:
OlegIvaniv 2023-05-24 15:01:06 +02:00 committed by GitHub
parent 011d5778b1
commit 0d88bd7c1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@
<n8n-text size="small" :bold="true" color="warning"> <n8n-text size="small" :bold="true" color="warning">
{{ {{
locale.baseText('executionUsage.currentUsage.count', { locale.baseText('executionUsage.currentUsage.count', {
adjustToNumber: daysLeftOnTrial, adjustToNumber: daysLeftOnTrial || 0,
}) })
}} }}
</n8n-text> </n8n-text>

View file

@ -64,7 +64,7 @@ export class I18nClass {
key: BaseTextKey, key: BaseTextKey,
options?: { adjustToNumber?: number; interpolate?: { [key: string]: string } }, options?: { adjustToNumber?: number; interpolate?: { [key: string]: string } },
): string { ): string {
if (options && options.adjustToNumber) { if (options?.adjustToNumber !== undefined) {
return this.i18n.tc(key, options.adjustToNumber, options && options.interpolate).toString(); return this.i18n.tc(key, options.adjustToNumber, options && options.interpolate).toString();
} }