Skip to content

Translation bot generates incorrect output for plural translation keys #94343

Description

@melvin-bot

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.InternalRequires API changes or must be handled by Expensify staffOverdueWeeklyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions