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] Sheet Workers and Foreign Languages

1545126950
Finderski
Pro
Sheet Author
Compendium Curator
I fear the answer is, "Sorry...can't be done" but in the off chance I'm wrong... There are times when a sheet worker will update a field with text (use case: Savage Worlds short sword do Str+d6 damage) in this case, "Str." I recognize that Str is great for English, but may be inappropriate for French or Portuguese, etc. Is it possible to leverage the translation file to write the text to the field using the translation file for the appropriate language? I can't use the datai18n on the field itself, because it may not always be Str, perhaps it's Spi (spirit). I could use the actual value of the strength field, but then that would necessitate an update to the field anytime Str changes value. Any thoughts on how I might accomplish this?
1545147984

Edited 1545148008
Cassie
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Greetings Finderski, Indeed you can. :) You can pull the keys themselves from the translation file with  getTranslationByKey([key]) . Also there is  getTranslationLanguage()   which the sheet workers can use to know what language the sheet is being used in. You could hardcode different results based on this potentially.  Depending on your scenario these two things will likely accomplish what you're looking to do.  I've never used them but I would be interested to see your results.
1545148380
Finderski
Pro
Sheet Author
Compendium Curator
Awesome! I'll give it a try and report back. :)
1545168284
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can confirm that this works very well. I use it in a couple places in the Official Starfinder sheet.
1545171326
Finderski
Pro
Sheet Author
Compendium Curator
Scott C. said: Can confirm that this works very well. I use it in a couple places in the Official Starfinder sheet. So, do I need to use the getTranslationLanguage()? If so, how do I specify which key to get? I was looking at the documentation and those functions look like they can be used independently?
1545174143
Natha
Forum Champion
Sheet Author
API Scripter
Finderski said: Scott C. said: Can confirm that this works very well. I use it in a couple places in the Official Starfinder sheet. So, do I need to use the getTranslationLanguage()? If so, how do I specify which key to get? I was looking at the documentation and those functions look like they can be used independently? You shouldn't need to use getTranslationLanguage(). getTranslationByKey() will get you the translation string in the current language set by the player.
1545176358
Finderski
Pro
Sheet Author
Compendium Curator
Awesome! Thanks for your help, everyone! :)