react-localize
A simple React Context wrapper and text localization component for localizing strings.
Documentation:
Please refer to our gitbook documentation for more detailed information & resources.
Getting Started, Quickly:
npm, Inc.*:
Install it fromnpm i react-localize
*or via yarn add react-localize
Example of usage:
;// this should come from your server or localization strings bundle source// for your application.const localizationBundle = 'app.button.Submit': 'Submit' foo: bar: 'Hey %s, you must be %d years old?' ; <LocalizationProvider messages=localizationBundle> <AnyParentComponent> <LocalizationConsumer> { return <div> <h1></h1> <button></button> <p></p> </div>; } </LocalizationConsumer> </AnyParentComponent></LocalizationProvider> // outputs:// <div>// <h1>prop.MissingValue</h1>// <button>Submit</button>// <p>Hey Stephen, you must be 34 years old?</p>// </div>