Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Pushing out Translations from an API

1576293249

Edited 1576294729
Victor B.
Pro
Sheet Author
API Scripter
Is this possible?  Will the browser detect the JSON translations and auto-magic do this?  If not is this possible?  I have div content being created from within API and sent to chat.  
1576595069
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It's not natively aupported, and unless you're message sent from the API is using a roll template (which I'm pretty sure you aren't), the message can't use the translation keys already included in the character sheet. What you could do is create your own json of translation keys and values indexed by language tag and have the script substitute them prior to sending the message. However, there are a few caveats; 1) I can't remember if the API has any way to access the language setting of a given player, and 2) the replacement can't be unique to each person that receives the message so you could make a French output or an English output, but not output that reads English to me and french to you.
1576605761
Victor B.
Pro
Sheet Author
API Scripter
Yep. That's what I figured. Thanks Scott