Skip to content

Commit 78bd10d

Browse files
authored
Merge pull request #283 from esbenam/avoid-throwing-errors-in-translations
Don't throw an error when missing a translation - just log
2 parents fc81adb + 537ada7 commit 78bd10d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

HTMLCS.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ _global.HTMLCS = new function()
8484
var translations = _global.translation[this.lang];
8585

8686
if (!translations) {
87-
throw new Error ('Missing translations for language ' + this.lang);
87+
console.error('Missing translations for language ' + this.lang);
88+
return '';
8889
}
8990

9091
var translation = translations[text];
9192

9293
if (!translation) {
93-
throw new Error('Translation for "' + text + '" does not exist in current language ' + this.lang);
94+
console.error('Translation for "' + text + '" does not exist in current language ' + this.lang);
95+
return '';
9496
}
9597

9698
return translation;

0 commit comments

Comments
 (0)