Skip to content

Commit

Permalink
Update hooks.js
Browse files Browse the repository at this point in the history
Fix #346
  • Loading branch information
mclemente committed Jan 16, 2024
1 parent 668fa81 commit 2a251e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ export default class PolyglotHooks {
displayTranslated
&& (lang !== game.polyglot.languageProvider.defaultLanguage || message.polyglot_unknown)
) {
html.find(".message-content")[0].innerText = content;
html.find(".message-content")[0].empty().append(content);

if (
forceTranslation
|| (!game.polyglot._isTruespeech(lang) && !message.polyglot_unknown && (isGM || !hideTranslation))
) {
html.find(".message-content").append(translation);
}
} else if (!forceTranslation && message.polyglot_unknown) {
html.find(".message-content")[0].innerText = content;
html.find(".message-content")[0].empty().append(content);
}

if (isGM || ((known || understood) && !hideTranslation)) {
Expand Down

0 comments on commit 2a251e5

Please sign in to comment.