Last post Sep 12, 2019 04:40 PM by EnenDaveyBoy
Sep 10, 2019 08:59 PM|EnenDaveyBoy|LINK
I am looking to localize my site, i would prefer not to use static files, to allow the localization to be controller from a database, but i can't find any good examples.
My main concern are my storage considerations for the client, i know what localstorage is and state, but i have very little experience and i am worried about the impact and other considerations, putting all my resource references into one or the other.
I can find lots of resources with simple examples but nothing with greater info to help me understand it better.
Any suggests would be appriciated.
Sep 11, 2019 02:57 AM|Fei Han - MSFT|LINK
I am looking to localize my site, i would prefer not to use static files, to allow the localization to be controller from a database
It seems that you'd like to store your language specific data in database instead of in static file (such as json or .js file), and you want to dynamically and programmatically supply these language specific data for localization module. If that is the case,
you can create a back-end service for retrieve language specific data from database and consume it from your react app to dynamically populate and supply expected data for localization module function(s).
Sep 11, 2019 02:36 PM|EnenDaveyBoy|LINK
thanks for the info, but my concern isn't the backend integrations its the front end considerations.
Like should i download all the resource references at the sametime in one api call,which could be 1000+ references (although each one would be small), or just do them as the page is requested, which would lead to more api calls.
and then what the best storage practice, should i hold the information in state,which would lead to one extra component level (not a massive issue) but would mean i would need to request the resourses every request, or hold the information in localstorage
or session storage.
Sep 12, 2019 03:26 PM|bruce (sqlwork.com)|LINK
not sure why you are not using a supported method like react-intl and babel/webpack as a helper.
Sep 12, 2019 04:40 PM|EnenDaveyBoy|LINK
i hadn't found it while searching tbh, i had been searching for localization not translation and it didn't show up.
Thanks for the link.