refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
28.65k stars 2.24k forks source link

[FEAT] Typing for i18next is too rigid #6313

Open bombillazo opened 2 months ago

bombillazo commented 2 months ago

Describe the bug

We are using i18next for our translations, and the Refine i18n provider uses a generic interface for the translate function.

i18next allows for array keys but that is currently incompatible with the current i18nProvider translate function type.

Steps To Reproduce

N/A

Expected behavior

We should be able to handle translations via the refine hook with array key translations

Packages

Additional Context

No response

aliemir commented 2 months ago

Hey @bombillazo thank you for the report. I think we can work on allowing customization of the translation key type with module augmentation 🤔 We already had some plans on this and this will be a good addition to the set of customization we can offer.

Until we have something to show for it, I think as a workaround you can pass the array key in an object using the second argument.

stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.