QuizL10n.prototype = {
__: function (str, replace = {}) {
- if (this.quiz.data.translations) {
- if (this.quiz.data.translations[str] !== undefined && this.quiz.data.translations[str] != null) {
- str = this.quiz.data.translations[str];
- }
- } else if (this.quiz.data.l10n[str] !== undefined && this.quiz.data.l10n[str] != null) {
+ if (this.quiz.data.l10n[str] !== undefined && this.quiz.data.l10n[str] != null) {
str = this.quiz.data.l10n[str];
}
- for(const k in replace) {
- str = str.replace(':'+k,replace[k])
+ for (const k in replace) {
+ str = str.replace(':' + k, replace[k])
}
return str;