This commit is contained in:
Philip Giuliani 2018-05-30 16:59:14 +02:00
parent 41c7dff0e8
commit 23c21252e8
4 changed files with 12 additions and 6 deletions

12
dist/plyr.js vendored
View File

@ -1300,6 +1300,14 @@ var utils = {
}, },
// Get a nested value in an object
getDeep: function getDeep(object, value) {
return value.split('.').reduce(function (obj, key) {
return obj[key] || {};
}, object);
},
// Get the closest value in an array // Get the closest value in an array
closest: function closest(array, value) { closest: function closest(array, value) {
if (!utils.is.array(array) || !array.length) { if (!utils.is.array(array) || !array.length) {
@ -1775,9 +1783,7 @@ var i18n = {
return ''; return '';
} }
var string = key.split('.').reduce(function (o, i) { var string = utils.getDeep(config.i18n, key);
return o[i] || {};
}, config.i18n);
if (utils.is.empty(string)) { if (utils.is.empty(string)) {
return ''; return '';

2
dist/plyr.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long