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

Dynamically referencing translation values?

1516643042
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'm wondering if it is possible to use the value of an attribute as a translation key in a roll. Something like this (doesn't work): ^{@{translation_test}} I'm trying to avoid having to make a separate attribute for the translated text of some drop downs that are referenced in some rolls.
1516643292
Jakob
Sheet Author
API Scripter
Scott, that should actually work (but remember that translation keys only work in a roll template).
1516643606

Edited 1516643722
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yeah, I realize it should work, but I keep getting the following: TypeError: c is undefined And, yes I am doing this in the template, not just as a free roll. I've got the following key-value pair in my translation JSON (and I know it works, cause it shows up properly on the sheet): "core":"CORE", Doing the following works: &{template:sf_attack} {{notes=^{core} }} And then I have a test attribute called translation_test that is set to core, however the following gives me the typeError: &{template:sf_attack} {{notes=^{@{translation_test}} }}//I've also tried this with spaces between the translation brackets and the attribute call Any ideas? And, I'm a bloody idiot. The error was due to incorrect attribute call.
1516643999

Edited 1516644023
Jakob
Sheet Author
API Scripter
That's really odd, I've used it before and tested it again just now in different circumstances, and it works. There must be something else at work. I don't even know how you would produce a typeError here without an inline roll... EDIT: good to know it works after all :).