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

[HELP] Internationalization

1553831045
Finderski
Pro
Sheet Author
Compendium Curator
I have some roll formulas that emote things. How do I internationalize those? Especially since they will likely have a roll somewhere in the middle.  Do I need to put a span tags within the roll formula? If I do that, do I need to use the data-i18n-vars thing?  If so, now do I set up the translation file for that? For example, the wiki provides this: <span data-i18n="var-test" data-i18n-vars="will not|be translated">This text {{0}} {{1}}</span> ...but it doesn't show what the translation key:value  pair is supposed to look like? Any help would be appreciated...
1553857149
Finderski
Pro
Sheet Author
Compendium Curator
Right, but the problem is this: <button type="roll" name="roll_emotethis" value="/em does something with dice and roll [[1d6>5]] and this thing happens">Roll the emote</button> According to the wiki, there's no data-i18n-value like there is a for placeholder (in fact the only supported attributes are:  title, alt, aria-label, label, placeholder) .  So, if I want that text to be translated, is there a way to do that? If not, I can do a roll template, but would the translation file be able to handle the roll as part of the value? I know how to pass internationalized text to a roll template, just not sure if it handles things like rolls in it. So, why ask about the vars? Because perhaps that would be a way to split the translation around the dice, essentially the die roll becoming the variable that's not translated. I'm still not certain if that would do what I want it to do or not...just exploring options.
1553865282
Andreas J.
Forum Champion
Sheet Author
Translator
So did you try and see what happened, or are we just speculating?
1553866311
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
To internationalize a roll, you'll need to use a roll template, or make the content of the chat stored in an attribute that you can modify via a sheetworker. I have never figured out how to is the variable translation keys for replacing only parts of a string. If you use a roll template you can just use the same data-i18n html you normally use or use the translation reference syntax in the roll itself (e.g. ^{some-translation-key}).
1553866322

Edited 1553866339
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
To internationalize a roll, you'll need to use a roll template, or make the content of the chat stored in an attribute that you can modify via a sheetworker. I have never figured out how to use the variable translation keys for replacing only parts of a string. If you use a roll template you can just use the same data-i18n html you normally use or use the translation reference syntax in the roll itself (e.g. ^{some-translation-key}).
1553867840
Finderski
Pro
Sheet Author
Compendium Curator
Andreas J. said: So did you try and see what happened, or are we just speculating? Not sure I understand the question...I had no idea how to do anything with the above code. :( Scott C. said: To internationalize a roll, you'll need to use a roll template, or make the content of the chat stored in an attribute that you can modify via a sheetworker. I have never figured out how to is the variable translation keys for replacing only parts of a string. If you use a roll template you can just use the same data-i18n html you normally use or use the translation reference syntax in the roll itself (e.g. ^{some-translation-key}). And that's what I was going to do as a last resort...I've actually created a roll template that kind of simulates an /em from a formatting perspective (not exactly right, but close enough for government work), so that's what I'll do I guess. @Roll20 Team = can we get an example of the data-i18n with variables from a translation/key perspective?  The example you provided doesn't tell me what the key/value pair for "var-test" would look like.  If it's just "This text" then I don't understand the value of the data-i18n-vars...