I currently use the i18n module on the client side instead of build time, even when 90% of the text is not dynamic. I also bring both languages even it's impossible to use them at the same time, this will grow exponentially the more translations and languages we have.
Core Ideas
Remove unnecessary client-side translation. Pass the already localized text from Astro at build time
(extra) Remove calls to the unused language. For example, if we are on /es, there is no need to import the JSON translation.
If we can split the translations from the actual i18n helper, even better.
I currently use the i18n module on the client side instead of build time, even when 90% of the text is not dynamic. I also bring both languages even it's impossible to use them at the same time, this will grow exponentially the more translations and languages we have.
Core Ideas