forked from rmdort/react-redux-multilingual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
99 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
IntlReducer: require('./reducer'), | ||
withTranslate: require('./withTranslate'), | ||
IntlProvider: require('./provider'), | ||
IntlActions: require('./actions') | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.IntlActions = exports.IntlProvider = exports.withTranslate = exports.IntlReducer = undefined; | ||
|
||
var _reducer = require('./reducer'); | ||
|
||
var _reducer2 = _interopRequireDefault(_reducer); | ||
|
||
var _withTranslate = require('./withTranslate'); | ||
|
||
var _withTranslate2 = _interopRequireDefault(_withTranslate); | ||
|
||
var _provider = require('./provider'); | ||
|
||
var _provider2 = _interopRequireDefault(_provider); | ||
|
||
var _actions = require('./actions'); | ||
|
||
var IntlActions = _interopRequireWildcard(_actions); | ||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
exports.IntlReducer = _reducer2.default; | ||
exports.withTranslate = _withTranslate2.default; | ||
exports.IntlProvider = _provider2.default; | ||
exports.IntlActions = IntlActions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
supplant: function supplant(s, d) { | ||
for (var p in d) { | ||
s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]); | ||
} | ||
return s; | ||
}, | ||
translateKey: function translateKey(path, obj, safe) { | ||
return path.split('.').reduce(function (prev, curr) { | ||
return !safe ? prev[curr] : prev ? prev[curr] : undefined; | ||
}, obj); | ||
}, | ||
createHTMLMarkup: function createHTMLMarkup(html) { | ||
return { __html: html }; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.supplant = supplant; | ||
exports.translateKey = translateKey; | ||
exports.createHTMLMarkup = createHTMLMarkup; | ||
function supplant(s, d) { | ||
for (var p in d) { | ||
s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]); | ||
} | ||
}; | ||
return s; | ||
} | ||
|
||
function translateKey(path, obj, safe) { | ||
return path.split('.').reduce(function (prev, curr) { | ||
return !safe ? prev[curr] : prev ? prev[curr] : undefined; | ||
}, obj); | ||
} | ||
|
||
function createHTMLMarkup(html) { | ||
return { __html: html }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
module.exports = { | ||
IntlReducer: require('./reducer'), | ||
withTranslate: require('./withTranslate'), | ||
IntlProvider: require('./provider'), | ||
IntlActions: require('./actions') | ||
import IntlReducer from './reducer' | ||
import withTranslate from './withTranslate' | ||
import IntlProvider from './provider' | ||
import * as IntlActions from './actions' | ||
|
||
export { | ||
IntlReducer, | ||
withTranslate, | ||
IntlProvider, | ||
IntlActions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
module.exports = { | ||
supplant (s, d) { | ||
for (var p in d) { | ||
s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]) | ||
} | ||
return s | ||
}, | ||
translateKey (path, obj, safe) { | ||
return path.split('.').reduce((prev, curr) => { | ||
return !safe ? prev[curr] : (prev ? prev[curr] : undefined) | ||
}, obj) | ||
}, | ||
createHTMLMarkup (html) { | ||
return { __html: html } | ||
}, | ||
export function supplant (s, d) { | ||
for (var p in d) { | ||
s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]) | ||
} | ||
return s | ||
} | ||
|
||
export function translateKey (path, obj, safe) { | ||
return path.split('.').reduce((prev, curr) => { | ||
return !safe ? prev[curr] : (prev ? prev[curr] : undefined) | ||
}, obj) | ||
} | ||
|
||
export function createHTMLMarkup (html) { | ||
return { __html: html } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters