Skip to content

Format and translate your texts

Notifications You must be signed in to change notification settings

unirakun/k-intl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k-intl

React HOC to provide internationalization. This HOC uses intl-messageformat to format your text. (see full documentation)

CircleCI Coverage Status NPM Version Size Greenkeeper badge

Installation

  • yarn add k-intl
  • npm install --save k-intl

How to use me?

Load locale on your store with this path: store.config.locale

/* en.json */
{
  "meeseeks": {
    "sayHello": "I'm Mr. Meeseeks!"
  }
}

Wrap your component with container

/* meeseeks.container.js */

import intl from 'k-intl'
import Component from './meeseeks.jsx'

export default intl('meeseeks')(Component)

And use the provided props messages on your component

/* meeseeks.jsx */

export default ({ messages }) => <div>{messages.sayHello}</div>

About uni rakun

uni rakun is created by two passionate french developers.

Do you want to contact them? Go to their website

Guillaume CRESPEL Fabien JUIF

Releases

No releases published

Packages

No packages published