Skip to content

Node.js based forum software built for the modern web

refactor: if key is fasly use empty string

Barış Soner Uşaklı1cc93c560cf7
diff --git a/public/src/modules/translator.common.js b/public/src/modules/translator.common.js
index 1a37580935..7e4d4869a9 100644
--- a/public/src/modules/translator.common.js
+++ b/public/src/modules/translator.common.js
@@ -545,7 +545,7 @@ module.exports = function (utils, load, warn) {
lang = lang || Translator.getLanguage();
// convert old format([[topic:moved-from]]) to new format [token, args, language]
- data = data.map(key => (typeof key === 'string' ? [key, [], lang] : key));
+ data = data.map(key => (typeof key === 'string' ? [key || '', [], lang] : key));
const translations = await Promise.all(data.map(async (item) => {
const [token, itemArgs, language] = item;