mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 14:05:05 +02:00
Fix error for message without translation (#10152)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -86,7 +86,8 @@ export function hasTranslate (
|
||||
|
||||
if (translateTo == null || translateTo === '') return false
|
||||
if (message.language != null && dontTranslate.includes(message.language)) return false
|
||||
const res = (message.translates?.[translateTo] ?? '').trim()
|
||||
const translated = message.translates?.[translateTo]
|
||||
const res = typeof translated === 'string' ? translated.trim() : ''
|
||||
|
||||
return res !== ''
|
||||
}
|
||||
@@ -138,7 +139,8 @@ export function getMessageTranslation (
|
||||
|
||||
if (translateTo == null || translateTo === '') return undefined
|
||||
if (message.language != null && dontTranslate.includes(message.language)) return undefined
|
||||
const res = (message.translates?.[translateTo] ?? '').trim()
|
||||
const translated = message.translates?.[translateTo]
|
||||
const res = typeof translated === 'string' ? translated.trim() : ''
|
||||
|
||||
return res !== '' ? toMarkup(res) : undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user