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

Use i18n translation in macros

Hello, We are working on a character sheet using i18n translation tools (json files for each language, data-i18n tags in html code ...) and it's working very fine for the character sheet. But now I would like to write macros that also use the translation json files. For example, I have a macro that display specific information and then roll dices. Something like : &amp;{template:default} {{name=@{selected|character_name} attacks @{target|character_name}}} /r 1D12 + @{selected|weapon_rating_1}D6 It will display something like " Tommy attacks Bobby " and then the rolled dices and result. But the verb " attacks " is in english and i would like to automatically replace it by its translation in the current account language. For example in french I would get " Tommy attaque Bobby ", in spanish it would be something like " Tommy ataca a Bobby ". I have tested many ways indicated in <a href="https://wiki.roll20.net/Character_Sheet_i18n" rel="nofollow">https://wiki.roll20.net/Character_Sheet_i18n</a> but I'm not successfull. So if something knows the solution, I thank him in advance :-) Ghorin
1536419460
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Translations can be used in chat only from within a roll template defined by the character sheet. To do this, wrap the translation key in curly brackets with a carat in front (e.g. ^{attack} ). This won't work with the default template, or with untemplated chat messages.
ok thank you Scott for the answer. I will look at roll templates.