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
8 changed files
with
40 additions
and
34 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
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,6 @@ | ||
export function setLocale (locale) { | ||
export function setLocale(locale) { | ||
return { | ||
type: 'SET_LOCALE', | ||
locale | ||
} | ||
} | ||
} |
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
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 @@ | ||
export function supplant (s, d) { | ||
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) { | ||
export function translateKey(path, obj, safe) { | ||
return path.split('.').reduce((prev, curr) => { | ||
return !safe ? prev[curr] : (prev ? prev[curr] : undefined) | ||
return !safe ? prev[curr] : prev ? prev[curr] : undefined | ||
}, obj) | ||
} | ||
|
||
export function createHTMLMarkup (html) { | ||
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