League-of-Foundry-Developers / fvtt-module-theatre

GNU General Public License v3.0
32 stars 41 forks source link

add polyglot support #135

Closed Sojournophile closed 1 year ago

Sojournophile commented 1 year ago

Reintroduces and updates polyglot integration to use polyglot's new members. A better way to do this would be probably to use isLanguageUnderstood() or something, but I'm a JS newbie.

This, at least:

-Scrambles the text contents of theatre insert text boxes for players who don't understand the Polyglot language used -Will not scramble for GMs, or users named "Stream" or "stream" (for the default use case of the popular Stream View module). Probably overkill to add an option for this; people who really want scrambled messages for all can just edit out the name check.

I don't think this will correctly take into account omniglot or comprehend languages, but it should be enough of a basic patch to make most users of both modules happy. I'll have more of a look later.

I've tested it on my machine but this is one of my first commits to a public repo so please double check if you have time.

Thanks again for updating theatre to v11; I have a game in a few hours, so I was very pleased to see it back.