Problem
The translation bot produces incorrect output when handling plural translation keys (i.e. keys whose value is a function returning an object with one/other plural forms).
Expected output
For a plural key like:
codingRules: ({sourcePolicyName}: {sourcePolicyName: string}) => ({
one: `copió 1 regla de comercio de ${sourcePolicyName}`,
other: (count: number) => `copió ${count} reglas de comercio de ${sourcePolicyName}`,
}),
The bot should produce the same structure — a function accepting the input params and returning an object with plural forms.
Actual output
The bot flattens the object and strips the outer function wrapper and input parameters, producing something like:
codingRules: {one: `copiou 1 regra de comerciante de ${sourcePolicyName}`, other: (count: number) => `copiou ${count} regras de comerciante de ${sourcePolicyName}`},
This breaks TypeScript types and will cause runtime errors or fall back to an unavailable translation.
Additional issue
When generating translations for languages with a different number of plural forms than English (e.g. languages with zero, two, few, many forms), the bot should generate the correct plural forms for that language — not just mirror the English one/other structure.
References
Problem
The translation bot produces incorrect output when handling plural translation keys (i.e. keys whose value is a function returning an object with
one/otherplural forms).Expected output
For a plural key like:
The bot should produce the same structure — a function accepting the input params and returning an object with plural forms.
Actual output
The bot flattens the object and strips the outer function wrapper and input parameters, producing something like:
This breaks TypeScript types and will cause runtime errors or fall back to an unavailable translation.
Additional issue
When generating translations for languages with a different number of plural forms than English (e.g. languages with
zero,two,few,manyforms), the bot should generate the correct plural forms for that language — not just mirror the Englishone/otherstructure.References