react i18 translation not working at adobe runtime io | Community
Skip to main content
July 23, 2024
Solved

react i18 translation not working at adobe runtime io

  • July 23, 2024
  • 2 replies
  • 778 views

My project is built on aem react spa with ssr and for translation i used npm package "i18next" and this works well client side and also working when ssr is done by express by reinitializing i18next at server side . But when i use adobe runtime io for ssr it does not return translated texts in the content , how can i handle this.

if i18 works on client side then initially label load from ssr and then when react bundle loads on client then all labels change as per i18. it is not.a good user experience.
i want i18 to work along with server side rendering. so that ssr output comes as per i18 translations only.

I am able ot make it work when I do SSR using express . Cant make it work when I do ssr using adobe IO runtime .

reference - i18 documentation for ssr (https://react.i18next.com/legacy-v9/serverside-rendering)

ssr with adobe I/O  ==> https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/hybrid/ssr#when-to-use-ssr

Does Adobe I/O uses express inside it ? if yes then how can we manipulate that 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi, 

Adobe I/O runtime has already pre-installed express, so you can use it in your action to achieve what you need. Please see here: https://developer.adobe.com/runtime/docs/guides/reference/runtimes/ 

Hope this helps

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 23, 2024

Hi, 

Adobe I/O runtime has already pre-installed express, so you can use it in your action to achieve what you need. Please see here: https://developer.adobe.com/runtime/docs/guides/reference/runtimes/ 

Hope this helps

Esteban Bustamante
kautuk_sahni
Community Manager
Community Manager
July 23, 2024

@nishantga Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni