diff options
author | Sam Potts <sam@potts.es> | 2018-08-13 21:39:16 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-08-13 21:39:16 +1000 |
commit | 297f297d181b694446e04f653da694660e9971b4 (patch) | |
tree | 1a3da50b1cb0e48d9ddfcd4bc2f399b084762310 /src/js/i18n.js | |
parent | 059205c378161c59bc7e7ab7798122a0fff0edbb (diff) | |
download | plyr-297f297d181b694446e04f653da694660e9971b4.tar.lz plyr-297f297d181b694446e04f653da694660e9971b4.tar.xz plyr-297f297d181b694446e04f653da694660e9971b4.zip |
Moved i18n to utils
Diffstat (limited to 'src/js/i18n.js')
-rw-r--r-- | src/js/i18n.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/js/i18n.js b/src/js/i18n.js deleted file mode 100644 index 5b0ebbab..00000000 --- a/src/js/i18n.js +++ /dev/null @@ -1,34 +0,0 @@ -// ========================================================================== -// Plyr internationalization -// ========================================================================== - -import is from './utils/is'; -import { getDeep } from './utils/objects'; -import { replaceAll } from './utils/strings'; - -const i18n = { - get(key = '', config = {}) { - if (is.empty(key) || is.empty(config)) { - return ''; - } - - let string = getDeep(config.i18n, key); - - if (is.empty(string)) { - return ''; - } - - const replace = { - '{seektime}': config.seekTime, - '{title}': config.title, - }; - - Object.entries(replace).forEach(([key, value]) => { - string = replaceAll(string, key, value); - }); - - return string; - }, -}; - -export default i18n; |