5.1.1 • Published 4 years ago

react-localize v5.1.1

Weekly downloads
336
License
ISC
Repository
github
Last release
4 years ago

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:

Install it from npm, Inc.*:

npm i react-localize

*or via yarn add react-localize

Example of usage:

import { LocalizationProvider, LocalizationConsumer } from 'react-localize';
// 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>
      {({ localize }) => {
        return <div>
          <h1>{localize('prop.MissingValue')}</h1>
          <button>{localize('app.button.Submit')}</button>
          <p>{localize('foo.bar', ['Stephen', 34])}</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>
5.1.1

4 years ago

5.1.0

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.0.0-beta.2

6 years ago

4.0.0-beta.1

6 years ago

4.0.0-alpha.4

6 years ago

4.0.0-alpha.3

6 years ago

4.0.0-alpha.2

6 years ago

4.0.0-alpha.1

6 years ago

3.0.0

7 years ago

3.0.0-beta

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.0-rc4

8 years ago

1.0.0-alpha

8 years ago

0.9.0-alpha

8 years ago

1.0.0

8 years ago

1.0.0-rc3

8 years ago

1.0.0-rc2

8 years ago

1.0.0-rc1

8 years ago

1.0.0-init

8 years ago