@hi18n/react
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Core library for hi18n

See hi18n's README for general information.

LocaleProvider

Configures the locale context.

<LocaleProvider locale="en">
  <App />
</LocaleProvider>

useI18n

Retrieves a translation helper from a book and the locale from the context.

const { t } = useI18n(book);

LocaleContext

It provides an advanced control over the locale context.

Translate

Translates the message, possible interleaved with React elements.

<Translate book={book} id="example/greeting">
  <a key="link" href="" />
</Translate>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.5
    1,090
    • latest

Version History

Package Sidebar

Install

npm i @hi18n/react

Weekly Downloads

1,091

Version

0.1.5

License

MIT

Unpacked Size

72.5 kB

Total Files

10

Last publish

Collaborators

  • qnighy