Menu

Suggest translation files organisation for i18next

Reddit r/reactjs·u/hexwit·6 months ago
#bD0FScs6
#component#i18next#translation#files#i18n
Reading 0:00
15s threshold

Currently I am integrating react-i18next library to enable different languages in my app ui.

As I understood from the documentation i18next suppose to have all translations inside language files, that are loaded on demand. But IMHO from DX point of view, such organization is not very convenient.

I assumed that it would be much more intuitive to keep translations along with components themselves. For example:

Component / Component.tsx Component.module.scss Component.i18n.json

But as per documentation - such translation file should be loaded separately. having many components such approach would require too many http requests to work. But from DX - i think it is the best.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.