aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/i18n.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-09-28 00:30:27 +1000
committerSam Potts <sam@potts.es>2018-09-28 00:30:27 +1000
commit515ae32160c8317cfddff07362d9aa399452d05d (patch)
tree597fe13a2a5da929dfc8ab88ed187578ae505529 /src/js/utils/i18n.js
parentdf8f0407954cc8a23755eb203dfca5f4939a632e (diff)
downloadplyr-515ae32160c8317cfddff07362d9aa399452d05d.tar.lz
plyr-515ae32160c8317cfddff07362d9aa399452d05d.tar.xz
plyr-515ae32160c8317cfddff07362d9aa399452d05d.zip
Moved hardcoded resources to i18n
Diffstat (limited to 'src/js/utils/i18n.js')
-rw-r--r--src/js/utils/i18n.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/js/utils/i18n.js b/src/js/utils/i18n.js
index f71e1a42..758ed695 100644
--- a/src/js/utils/i18n.js
+++ b/src/js/utils/i18n.js
@@ -6,6 +6,15 @@ import is from './is';
import { getDeep } from './objects';
import { replaceAll } from './strings';
+// Skip i18n for abbreviations and brand names
+const resources = {
+ pip: 'PIP',
+ airplay: 'AirPlay',
+ html5: 'HTML5',
+ vimeo: 'Vimeo',
+ youtube: 'YouTube',
+};
+
const i18n = {
get(key = '', config = {}) {
if (is.empty(key) || is.empty(config)) {
@@ -15,6 +24,10 @@ const i18n = {
let string = getDeep(config.i18n, key);
if (is.empty(string)) {
+ if (Object.keys(resources).includes(key)) {
+ return resources[key];
+ }
+
return '';
}