aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/i18n.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-04-28 22:20:49 +1000
committerGitHub <noreply@github.com>2020-04-28 22:20:49 +1000
commit99a26d65cf78851878841c5afc54830f1222ccb1 (patch)
tree6a2bf12ecfa2314725e6d8961ec9f6a986b5003b /src/js/utils/i18n.js
parent6aa21c1fae4a7b6dbcf1db1ee3b06f11d674869a (diff)
parent4915cf0120870db4a52b3be117efa22f8ca2bd3e (diff)
downloadplyr-99a26d65cf78851878841c5afc54830f1222ccb1.tar.lz
plyr-99a26d65cf78851878841c5afc54830f1222ccb1.tar.xz
plyr-99a26d65cf78851878841c5afc54830f1222ccb1.zip
Merge pull request #1796 from sampotts/develop
v3.6.0
Diffstat (limited to 'src/js/utils/i18n.js')
-rw-r--r--src/js/utils/i18n.js50
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;