The client ask us to translate 50 languages. Before we only had spanish and english so it's only two files, but now there will be 50 files. Each one has 2000 lines of translations.
So I think we have 2 options:
We maintain all the files locally, but it loads them for every site load, which is not efficient.
We move them to the backend, but now I depend on the backend to team to add new texts for features/when changing copy.
Has anyone had this problem? How can I solve it?
The ideal situation would be for React to only load the language it'll use, since I reload the page on language change anyway.
Definitely do not load all the language files. I18next handles this nicely, and should only load main language and fallback language. https://react.i18next.com/latest/i18next-instance