chore: remove unnecessary if
This commit is contained in:
parent
e55c6f99e2
commit
faea1c8224
|
@ -108,7 +108,6 @@ export function t(key: string, variables?: Record<string, any>): string {
|
||||||
if (!variables || !variables.count)
|
if (!variables || !variables.count)
|
||||||
throw new Error(`translation key ${key} is an object (is it a plural?)`);
|
throw new Error(`translation key ${key} is an object (is it a plural?)`);
|
||||||
|
|
||||||
if (variables.count) {
|
|
||||||
const pluralTag: Intl.LDMLPluralRule = variables.count === 0 ? "zero" :
|
const pluralTag: Intl.LDMLPluralRule = variables.count === 0 ? "zero" :
|
||||||
new Intl.PluralRules(bestLocale).select(variables.count);
|
new Intl.PluralRules(bestLocale).select(variables.count);
|
||||||
|
|
||||||
|
@ -120,7 +119,6 @@ export function t(key: string, variables?: Record<string, any>): string {
|
||||||
throw new Error(`translation key ${key} is an object and doesn't seem to be plural`);
|
throw new Error(`translation key ${key} is an object and doesn't seem to be plural`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!variables) return translation as string;
|
if (!variables) return translation as string;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue