We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f14df95 + 44e0ac7 commit e858f21Copy full SHA for e858f21
HTMLCS.js
@@ -81,11 +81,19 @@ _global.HTMLCS = new function()
81
* @return {String}
82
*/
83
this.getTranslation = function(text) {
84
- try {
85
- return _global.translation[this.lang][text];
86
- } catch (e) {
+ var translations = _global.translation[this.lang];
+
+ if (!translations) {
87
+ throw new Error ('Missing translations for language ' + this.lang);
88
+ }
89
90
+ var translation = translations[text];
91
92
+ if (!translation) {
93
throw new Error('Translation for "' + text + '" does not exist in current language ' + this.lang);
94
}
95
96
+ return translation;
97
};
98
99
/**
0 commit comments