aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js/i18n.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 58c3e7cf..d35daacc 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -6,11 +6,15 @@ import utils from './utils';
const i18n = {
get(key = '', config = {}) {
- if (utils.is.empty(key) || utils.is.empty(config) || !Object.keys(config.i18n).includes(key)) {
+ if (utils.is.empty(key) || utils.is.empty(config)) {
return '';
}
- let string = config.i18n[key];
+ let string = key.split('.').reduce((o,i) => o[i] || {}, config.i18n);
+
+ if (utils.is.empty(string)) {
+ return '';
+ }
const replace = {
'{seektime}': config.seekTime,