diff --git a/plugins/communication-resources/src/stores.ts b/plugins/communication-resources/src/stores.ts index cb1f85c1c44..efad8875851 100644 --- a/plugins/communication-resources/src/stores.ts +++ b/plugins/communication-resources/src/stores.ts @@ -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 }