-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Currently @shopify/i18next-shopify
does not have dedicated typescript support.
This results in typescript errors e.g. when using its custom pluralization with nested keys and using a declaration file as explained in https://www.i18next.com/overview/typescript#create-a-declaration-file
Example
i18n resource
"variants": {
"one": "{{count}} variant",
"other": "{{count}} variants"
}
usage
<Text variant="bodySm" as="p" tone="subdued">
{t('variants', {
count: 1,
})}
</Text>
typescript error
Argument of type '["variants", { count: number; }]' is not assignable to parameter of type '[key: "change" | "select" | "variants.one" | "variants.other" | TemplateStringsArray | ("change" | "select" | "variants.one" | "variants.other" | TemplateStringsArray)[], options?: ({ ...; } & InterpolationMap<...>) | undefined] | [key: ...] | [key: ...]'.
Type '["variants", { count: number; }]' is not assignable to type '[key: string | string[], defaultValue: string, options?: ({ count: number; } & $Dictionary) | undefined]'.
Type at position 1 in source is not compatible with type at position 1 in target.
Type '{ count: number; }' is not assignable to type 'string'.ts(2345)
Metadata
Metadata
Assignees
Labels
No labels