I’m adding multilingual support to an existing webpart. Easy enough with the different locale string files and testing with the --locale
pararmeter on gulp serve
.
What I don’t understand though is how the locale is picked up in production, I have a site, created in English. I have tried:
- Adding a translation for Spanish and publishing the new page – still English
- Changing my uuser account default language to Spanish – web part still shows in English.
I was hoping the webpart would display differently based on the user or the page translation, not the site language?
Also, is it possible to change the locale of the webpart at runtime? Potentially with a webpart prop or reading the user’s preferred language?
I have tried settng the cultureInfo
on the context to ‘es-ES’, pre-render (I know it’s supposed to be read only!), which did nothing.
Any ideas? Thanks