diff options
author | Sam Potts <sam@potts.es> | 2020-04-24 00:32:16 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2020-04-24 00:32:16 +1000 |
commit | 3b521f73bd773dcb530746db47c90dbb1349b70b (patch) | |
tree | 371bb120c654d55d0016792b9412fc122735c1b8 /src/js/utils/i18n.js | |
parent | 27126b20bc5d2a3a8947c363d1f1887533f69688 (diff) | |
parent | 68137aa789b195b26d4306eaebc7fee2f8eb3374 (diff) | |
download | plyr-3b521f73bd773dcb530746db47c90dbb1349b70b.tar.lz plyr-3b521f73bd773dcb530746db47c90dbb1349b70b.tar.xz plyr-3b521f73bd773dcb530746db47c90dbb1349b70b.zip |
Merge branch 'develop' of github.com:sampotts/plyr into develop
# Conflicts:
# package.json
# yarn.lock
Diffstat (limited to 'src/js/utils/i18n.js')
-rw-r--r-- | src/js/utils/i18n.js | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/js/utils/i18n.js b/src/js/utils/i18n.js index 5eee5829..70868527 100644 --- a/src/js/utils/i18n.js +++ b/src/js/utils/i18n.js @@ -8,40 +8,40 @@ import { replaceAll } from './strings'; // Skip i18n for abbreviations and brand names const resources = { - pip: 'PIP', - airplay: 'AirPlay', - html5: 'HTML5', - vimeo: 'Vimeo', - youtube: 'YouTube', + pip: 'PIP', + airplay: 'AirPlay', + html5: 'HTML5', + vimeo: 'Vimeo', + youtube: 'YouTube', }; const i18n = { - get(key = '', config = {}) { - if (is.empty(key) || is.empty(config)) { - return ''; - } + get(key = '', config = {}) { + if (is.empty(key) || is.empty(config)) { + return ''; + } - let string = getDeep(config.i18n, key); + let string = getDeep(config.i18n, key); - if (is.empty(string)) { - if (Object.keys(resources).includes(key)) { - return resources[key]; - } + if (is.empty(string)) { + if (Object.keys(resources).includes(key)) { + return resources[key]; + } - return ''; - } + return ''; + } - const replace = { - '{seektime}': config.seekTime, - '{title}': config.title, - }; + const replace = { + '{seektime}': config.seekTime, + '{title}': config.title, + }; - Object.entries(replace).forEach(([k, v]) => { - string = replaceAll(string, k, v); - }); + Object.entries(replace).forEach(([k, v]) => { + string = replaceAll(string, k, v); + }); - return string; - }, + return string; + }, }; export default i18n; |