aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/i18n.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-18 21:41:25 +1000
committerSam Potts <sam@potts.es>2018-06-18 21:41:25 +1000
commitcc3c0b54484e6f5a7b4dba8a36a44f345e462f26 (patch)
tree5fe2838546d9f981b21572dee88ee7a1c3195477 /src/js/i18n.js
parent4811e3333f1417bc9e14f6cc38afc789e9051c4c (diff)
parent3c9c1b4cdcd0eb9076c3f0bafbabb057ee140c42 (diff)
downloadplyr-cc3c0b54484e6f5a7b4dba8a36a44f345e462f26.tar.lz
plyr-cc3c0b54484e6f5a7b4dba8a36a44f345e462f26.tar.xz
plyr-cc3c0b54484e6f5a7b4dba8a36a44f345e462f26.zip
Merge branch 'develop'
Diffstat (limited to 'src/js/i18n.js')
-rw-r--r--src/js/i18n.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 62e5bdb0..5b0ebbab 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -2,17 +2,19 @@
// Plyr internationalization
// ==========================================================================
-import utils from './utils';
+import is from './utils/is';
+import { getDeep } from './utils/objects';
+import { replaceAll } from './utils/strings';
const i18n = {
get(key = '', config = {}) {
- if (utils.is.empty(key) || utils.is.empty(config)) {
+ if (is.empty(key) || is.empty(config)) {
return '';
}
- let string = utils.getDeep(config.i18n, key);
+ let string = getDeep(config.i18n, key);
- if (utils.is.empty(string)) {
+ if (is.empty(string)) {
return '';
}
@@ -21,11 +23,8 @@ const i18n = {
'{title}': config.title,
};
- Object.entries(replace).forEach(([
- key,
- value,
- ]) => {
- string = utils.replaceAll(string, key, value);
+ Object.entries(replace).forEach(([key, value]) => {
+ string = replaceAll(string, key, value);
});
return string;