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

Code Syntax: Translator for Skill Name [Genesys]

1582302575

Edited 1582302938
I will first state that I am 3 days new to modifying a Character Sheets beyond graphic changes. That said I have been using roll20 for sometime.  I am trying to modify the names of a few skills on the existing Genesys Character sheet (ex. Mechanics -> Tech-Use). I was able to update the Translator file to do this, and see the new name on the Character sheet... however when I use the dice roll button, the results (roll table) that shows up in the chat still utilize the old/base name (Mechanics) of the skill rather than the translator modified one (Tech-Use). I tracked down the code where it is happening: <tr data-i18n-list-item="mechanics" class="hide-mechanics hide-skill-row">                                 <td>                                     <label data-i18n="mechanicsint">Mechanics (Int)</label> <label class="hideskills"><input type="checkbox" name="attr_hide-mechanics" value="1"/> <span data-i18n="hide">Hide</span></label>                                 </td>                                 <td><input name='attr_careerskillMechanics' type="checkbox" value="1"></td>                                 <td><input type="number" name="attr_rankMechanics" max="6" min="0" value="0" /></td>                                 <td>                                     <input class="sheet-yd" type="hidden" name="attr_yMechanics" value="(((@{intellect} + @{rankMechanics}) - abs(@{intellect} - @{rankMechanics})) / 2)" disabled><span></span>                                     <input class="sheet-gd" type="hidden" name="attr_gMechanics" value="((((@{intellect} + @{rankMechanics}) + abs(@{intellect} - @{rankMechanics})) / 2) - @{yMechanics})" disabled><span></span>                                 </td>                                 <td>                                     <div class="sheet-dice-icon"></div>                                     <div class="sheet-dice-input">                                         <input type="text" name="attr_diceMechanics" />                                     </div>                                 </td>                                 <td><button type='roll' name='roll_Mechanics' value='!eed characterID(@{character_id}) label(skill:Mechanics) @{diceMechanics} skill(@{rankMechanics}|@{intellect}|Mechanics) @{dicePool} (gmdice)'></button></td> This seems to be the "problem", in the button call: label(skill:Mechanics) However I am not sure what proper syntax would be change the code to use the translator value. Wondering if there is a more experienced soul who could advise me, and perhaps point me to the best place to learn about using the translator values.
1582303742

Edited 1582303851
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
As this uses an API command, there is not an easy option for referencing the translation file. Your three options are: The API script that is used could be modified to output to chat using the sheets roll template which would allow dynamic reference to the translation value via ^{translation key}. Downside here is you're relying on an external code base to support this. Change the button so that the macro is stored in a hidden attribute. Then use a sheetworker to properly translate mechanic to tech use. Downside here is that the value gets changed to the same translation value for all users, regardless of language Change the button to send a normal roll template roll and not use the API. Pros: allows dynamic replacement as #1. Cons: lose the special handling I'm assuming the API is used for. Note: if your goal is to change what the sheet actually calls the skill, I'd recommend a much more in depth code change.
Thank you for the analysis. Note: if your goal is to change what the sheet actually calls the skill, I'd recommend a much more in depth code change. I originally considered this, but this sheet (as it is based on a universal game system) already has a lot of customization ability. Since Mechanics -> Tech-Use is really just a label change (the skill inherently is the same) I thought I might be able to use the translator as a less invasive approach. Yeah unfortunately the API was created because this game uses symbols rather than numeric dice, and the API displays graphic results, and cancellation formulas to present the end result.
1582314749
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, using the translator in this method isn't feasible if your goal is to make the sheet available for others as the translation is based on your Roll20 language, not something controllable by the sheet.
I have a lot to learn. Thanks again for your help.
1582320565
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
We've all been there, and we all continually find things that we don't understand