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

Using the Translation Feature From a Variable...

1510011079

Edited 1510011209
Robert D.
Sheet Author
I have a variable containing text that's in an emote that's in a button. At some point, I'm going to need to run that through the translation feature. I'm trying to get ahead of that problem while I'm working on the sheetworker that's manipulating the data that's inside the variable. In the following, is there a way to translate the content of the composition_approach_selected variable using the i18n feature? Eventually, I'll be doing the whole thing of course, but I just tried that one variable and couldn't figure out how. <td><button type="roll" value="/em @{Name} makes a Composition roll using the @{composition_approach_selected} approach!! \n\n/roll [[@{composition_approach}+@{keep_bonus_composition}]]t[Ring]+[[@{rank_composition}+@{roll_bonus_composition}]]t[Skill]"></button></td>
1510050775
Jakob
Sheet Author
API Scripter
If the content of @{composition_approach_selected} is a translation key, try ^{@{composition_approach_selected}} It's possible that this only works inside a roll template, not in a normal chat command, however... - haven't tested the latter.
1510079922
Lithl
Pro
Sheet Author
API Scripter
Note that you can also use  getTranslationByKey in your sheetworker script when setting the value of *_approach_selected
BTW the attack template bit didn’t work, so I converted the entire emote into chunks and used the sheet worker command to either define the pieces from the translation file during a normal sheetworker event or to define the translated text to variables when the sheet is opened (for the static parts). The button just emotes a string of variables now, and can be translated .