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 .
×

Translation in input-radio-value

Hi, I am trying to fix some i18n problems in a charactersheet I am using. I did not originally build the sheet, so I might miss something here. This is used for the use inside of roll templates: <input type="radio" name="attr_mod_option" class="title" value="?{Erleichterung(+) / Erschwernis(-), im Fall der Erleichterung ohne '+' eingeben|0}" checked="checked"/> This is used to get a popup in a roll template to ask for a a modifier.I have tried a lot of different ways to use the translation attribute "modOptionText" instead of the text in the value.  Any suggestions are welcome. 
1570991212

Edited 1570991463
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, you can't use the dynamic translation tools in roll queries because the prompt is not part of a roll template or character sheet. What you can do is use a sheetworker to translate an attribute that you use in the query. I do something similar in the Starfinder sheet. Here's a basic example: HTML <input type="radio" name="attr_mod_option" class="title" value="?{@{query_translation}|0}" checked="checked"/> <input type='hidden' name='attr_query_translation' value='Erleichterung(+) / Erschwernis(-), im Fall der Erleichterung ohne '+' eingeben'> JS on('sheet:opened',(event)=>{     const setObj = {         query_translation:getTranslationByKey('query_translation')     };     setAttrs(setObj,{s ilent:true }); }); German Translation JSON {     "query_translation":"Erleichterung(+) / Erschwernis(-), im Fall der Erleichterung ohne '+' eingeben" } Things to note here; this will set the query to a given translation for all users based on the last person who opened the sheet. Additionally, you should have a default value set for the holder attributes for if someone tries to call an attribute without opening the sheet. EDIT: removed the splitting of the query into 4 pieces as it's better to have the whole thing translated at once to accomodate changes in grammatical structure.
1570995129
vÍnce
Pro
Sheet Author
Scott C. said: What you can do is use a sheetworker to translate an attribute that you use in the query. Things to note here; this will set the query to a given translation for all users based on the last person who opened the sheet. Additionally, you should have a default value set for the holder attributes for if someone tries to call an attribute without opening the sheet. EDIT: removed the splitting of the query into 4 pieces as it's better to have the whole thing translated at once to accommodate changes in grammatical structure. Thanks for posting this example Scott.  Should be handy.
1570997119
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad to hear
Thanks so much for the answer. I was able to fix the issue with this.