mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-08 10:32:50 +02:00
dont translate non strings
This commit is contained in:
@@ -291,6 +291,10 @@
|
||||
lang = null;
|
||||
}
|
||||
|
||||
if (!(typeof text === 'string' || text instanceof String) || text === '') {
|
||||
return cb('');
|
||||
}
|
||||
|
||||
Translator.create(lang).translate(text).then(function (output) {
|
||||
return cb(output);
|
||||
}).catch(function (err) {
|
||||
|
||||
Reference in New Issue
Block a user