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

Sheet Authors: Dynamic Tab Labels Using Translation

1472358232

Edited 1472358249
Tired of seeing "Spellcasting Class 1" or the like on tabs on your character sheets? The Roll20 translation feature can help. Sheet HTML excerpts: <input type="radio" name="attr_spellclass-tab" value="1" title="Spellcasting Class 1" checked="checked"/> <span data-i18n="spellclass01-u" >Spellcasting Class 1</span> <input type="radio" name="attr_spellclass-tab" value="2" title="Spellcasting Class 2" /> <span data-i18n="spellclass02-u" >Spellcasting Class 2</span> <td style="width: 50px;">Classname</td> <td><input type="text" style="width: 197px;" name="attr_spellclass01" title="spellclass01" value="Spellcasting Class 1"></td> Translation file: { "spellclass01-u": "<span name=\"attr_spellclass01\"></span>", "spellclass02-u": "<span name=\"attr_spellclass02\"></span>" } Here it is in action (click image to animate):
1472368337
Lithl
Pro
Sheet Author
API Scripter
Uhh... I wouldn't recommend doing it this way. Just use <span name="attr_spellclass01">Spellcasting Class 1</span> instead of the data-i18n. You're creating an unnecessary step, and the translators don't necessarily know HTML and may screw up your clever plan when translating the sheet to another language.
D'oh! Thanks, Brian. I knew it was kludgy, but I had tried all kinds of ways to fix this before, though I was always using the @spellclass01 reference to the attribute name, so it never worked. I did not realize spans would work this way and thought it was unique to the translation feature. This is much simpler!