Skip to content

Commit

Permalink
Merge pull request #151 from mclemente/master
Browse files Browse the repository at this point in the history
Polyglot fixes
  • Loading branch information
megahead11 authored Oct 15, 2023
2 parents 74e0558 + bf59645 commit f31b4c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/scripts/TheatreActorConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

import { KHelpers } from "./KHelpers.js";
import { Theatre } from "./Theatre.js";

/**
* ============================================================
Expand Down
16 changes: 2 additions & 14 deletions src/scripts/theatre_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,8 @@ Hooks.on("createChatMessage", function (chatEntity, _, userId) {
// Get current language being processed
const lang = chatData.flags.polyglot.language;
// Fetch the languages known by current user
let langs = game.polyglot.getUserLanguages();
let understood = false;
for (lang_set of langs.values()) {
for (item of lang_set.values()) {
// If the user has a matching language in their list, we understand it
if (lang == item) {
understood = true;
break;
}
}
}
if (game.user.isGM || game.user.name == "Stream" || game.user.name == "stream") {
understood = true;
}
const langs = game.polyglot.knownLanguages;
const understood = langs.has(lang) || game.user.isGM || game.view === "stream";
if (!understood) {
// If not understood, scramble the text
const fontStyle = game.polyglot._getFontStyle(lang);
Expand Down

0 comments on commit f31b4c8

Please sign in to comment.