Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdort committed Jan 11, 2018
1 parent 2c550ff commit 63463d7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react", "es2015", "stage-0"]
"presets": ["env", "stage-0", "react"]
}
14 changes: 14 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ App.contextTypes = {
module.exports = App
````

## Setting the initial locale

Option 1: Pass your locale to initial state of your reducer
````
let store = createStore(reducers, { Intl: { locale: 'zh'}})
````

Option 2: Dispatch an action to change locale
````
import { IntlActions } from 'react-redux-multilingual'
let store = createStore(reducers)
store.dispatch(IntlActions.setLocale('zh'))
````
2 changes: 1 addition & 1 deletion example/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react", "es2015", "stage-0"]
"presets": ["env", "stage-0", "react"]
}
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"babel-core": "^6.9.1",
"babel-eslint": "^6.0.4",
"babel-loader": "^6.2.4",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
Expand Down
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},
resolve: {
alias: {
// 'react-redux-multilingual': path.join(__dirname, './../lib')
'react-redux-multilingual': path.join(__dirname, './../lib')
},
fallback: path.resolve(__dirname, './node_modules')
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"babel-cli": "^6.10.1",
"babel-core": "^6.9.1",
"babel-eslint": "^6.0.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0"
}
Expand Down

0 comments on commit 63463d7

Please sign in to comment.