I've created a new problem for myself... I have a sheetworker that sets the text for a hidden attribute " current_preset" . On the sheet I display the text as a named span. <span name=" attr_current_preset " data-i18n-dynamic ></span> I also include the attribute in sheet rolls which are displayed using a roll template. {{subtitle=^{ @{current_preset} }}} How do I add localization code for the text displayed, both on the sheet and as it's displayed with a sheet roll/roll template? here's some sample code I'm working with sheetworker /* set armor dice pool */
on("clicked:armor-roll", function() {
console.log(">>> Change Detected: Armor - button clicked <<<");
getAttrs(["ar"], function(values) {
const ar = parseInt(values.ar,10)||0;
setAttrs({
gear: ar,
current_preset : `Armor Roll`,
include_with_roll: ""
});
});
}); html (I thought to try data-i18n-dynamic on the span, but I have a feeling this only works for a referenced select attribute...? ) <span class="sheet-label" data-i18n="current-preset" >Current Preset</span>
<input class="sheet-input" type="hidden" name=" attr_current_preset " value="" readonly />
<span name=" attr_current_preset " data-i18n-dynamic ></span>
example sheet roll (notice I'm trying to use ^{foo} to get a translation) <button class="dice-pool" type="roll" name="roll_the_dice" value="&{template:forbiddenlands} {{subtitle=^{ @{current_preset} }}}"></button> Thanks