Skip to content

Commit

Permalink
Accept user provided translate
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinay authored and Vinay committed Aug 6, 2018
1 parent 47ab602 commit e675fab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-redux-multilingual",
"version": "2.0.1",
"version": "2.0.2",
"description": "A simple multilingual translate component and HOC for react and redux",
"main": "lib/index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class IntlProvider extends React.Component {
translations: {}
}
translate = (key, placeholders, isHTML, options = {}) => {
const result = translateKey(
/**
* Accept user defined translate
*/
const translateFn = this.props.translate || translateKey
const result = translateFn(
key,
this.props.translations[this.props.locale]['messages']
)
Expand Down

0 comments on commit e675fab

Please sign in to comment.