mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix system messages not being translated (#15405)
This commit is contained in:
@@ -129,9 +129,5 @@ export function translateMessage (lang, info) {
|
|||||||
default:
|
default:
|
||||||
msg = 'Error translating party chat. Unknown message type.';
|
msg = 'Error translating party chat. Unknown message type.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.includes('`')) {
|
|
||||||
msg = `\`${msg}\``;
|
|
||||||
}
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,7 +359,11 @@ schema.statics.toJSONCleanChat = async function groupToJSONCleanChat (group, use
|
|||||||
.map(chatMsg => {
|
.map(chatMsg => {
|
||||||
// Translate system messages
|
// Translate system messages
|
||||||
if (!_.isEmpty(chatMsg.info)) {
|
if (!_.isEmpty(chatMsg.info)) {
|
||||||
chatMsg.text = translateMessage(userLang, chatMsg.info);
|
chatMsg.unformattedText = translateMessage(userLang, chatMsg.info);
|
||||||
|
chatMsg.text = chatMsg.unformattedText;
|
||||||
|
if (!chatMsg.text.includes('`')) {
|
||||||
|
chatMsg.text = `\`${chatMsg.text}\``;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert to timestamps because Android expects it
|
// Convert to timestamps because Android expects it
|
||||||
|
|||||||
Reference in New Issue
Block a user