mozilla / remote-newtab

Remotely-hosted New Tab Page
https://mozilla.github.io/remote-newtab/src/
Mozilla Public License 2.0
15 stars 7 forks source link

React Localization #162

Open k88hudson opened 8 years ago

k88hudson commented 8 years ago

I think it would be preferable to use https://github.com/yahoo/react-intl since it hooks into the browser's native Intl stuff and isn't too big. Alternatively, we could use a redux store, but I think this is fine.

Past work in https://github.com/mozilla/remote-newtab/issues/114

cc @sarracini

sarracini commented 8 years ago

I agree with using something other than a redux store, since the strings never change once they're set and never change 'state', it seems unnecessary to use a store for them. The react-intl looks pretty good. Can we cache the strings and then just retrieve them in react's view?

k88hudson commented 8 years ago

@sarracini yep, since we have to prerender a page for each locale anyway (see https://github.com/mozilla/remote-newtab/issues/163) we could just render them into the page as a global. We could use fetch it at runtime, but that add a request and complicate the serviceworker configuration a bit