From de1e3230f5d157dbdc4d44d23820ae2ae9ff3eda Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 24 Sep 2013 15:23:16 -0400 Subject: [PATCH] fixed topics and admin views, broken after merge --- public/src/translator.js | 13 ++++++++----- public/templates/admin/header.tpl | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/public/src/translator.js b/public/src/translator.js index 234ad5853b..37f4486feb 100644 --- a/public/src/translator.js +++ b/public/src/translator.js @@ -48,12 +48,15 @@ loading = 0; function insertLanguage(text, key, value, variables) { - for (var i = 1, ii = variables.length; i < ii; i++) { - var variable = variables[i].replace(']]', ''); - value = value.replace('%' + i, variable); - } + if (value) { + for (var i = 1, ii = variables.length; i < ii; i++) { + var variable = variables[i].replace(']]', ''); + value = value.replace('%' + i, variable); + } - text = text.replace(key, value); + text = text.replace(key, value); + } + return text; } diff --git a/public/templates/admin/header.tpl b/public/templates/admin/header.tpl index 7c236cff58..3a2c7b4768 100644 --- a/public/templates/admin/header.tpl +++ b/public/templates/admin/header.tpl @@ -16,6 +16,7 @@ +