jeresig / i18n-node-2

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
507 stars 79 forks source link

How to access i18n object in React components? #107

Open scazzy opened 7 years ago

scazzy commented 7 years ago

I'd want to use i18n in react components under React router without adding to each component as props. One way is to use React provider context, but it isn't a recommended solution. Using React Router v4

gjuchault commented 7 years ago

I'm not sure what's the connection between i18n-node-2 and React Router. i18n-node-2 exposes a simple API, you'll have to deal with the React side :). You might also look into react-based i18n libraries