Skip to content

Chris-specs/quicki18n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickI18N

logo

Translations fast and easy for React and NextJS projects.

Installation

Install with yarn or npm

npm i quicki18n-react
yarn add quicki18n-react

Usage

Create your translation files with this structure.

|-- public
    |-- locales
        |-- en
        |   |-- common.json
        |-- es
        |   |-- common.json

Go to the root of your application and do this:

import { QuickProvider } from 'quicki18n-react'

const MyApp = () => (
    <QuickProvider locale='en'>
        { component }
    </QuickProvider>
)

Go to the component you need to insert a translation of and do this:

import { useQuick } from 'quicki18n-react'

const Component = () => {

    const { t } = useQuick()
  
    return (
        <h1>{t('translation_key')}</h1>
    )
}

Made with ❤️ & ⌨️ by Chris

About

Translations fast and easy for React and NextJS projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published