@bradtech/translations
TypeScript icon, indicating that this package has built-in type declarations

2.8.12 • Public • Published

Translations

install

with npm

$ npm install @bradtech/translations

with yarn

$ yarn add @bradtech/translations

Example

in index.js

import App from './App'
import { i18n, I18nextProvider } from '@bradtech/translations'

const load = () => {
   ;<I18nextProvider i18n={i18n}>
      <App />
   </I18nextProvider>
}

in App.js

import React from 'react'
import { compose } from 'recompose'
import { withTranslation } from 'react-i18next'

const App = props => {
   const { t } = this.props
   // we get our translation function in the props

   return (
      <div>
         <p>{t('home.welcome')}</p>
      </div>
   )
}

export default compose(withTranslation)(App)

in Cloud functions

import { i18n } from '@bradtech/translations'

i18n.init({
   lng: user.get('lang') || 'fr',
})

Readme

Keywords

none

Package Sidebar

Install

npm i @bradtech/translations

Weekly Downloads

1

Version

2.8.12

License

MIT

Unpacked Size

320 kB

Total Files

20

Last publish

Collaborators

  • elliottlepine
  • crapougnax