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 translating sheet

I've been following the tutorial i18n to translate a sheet. I've become a translator in Roll20. I see that i can translate some parts of the website. After the translation.js file  and the sheet with the i18n data are uploaded how do i proceed? I can't see an icon to translate even if im in translator mode. Can anybody help me? Maybe someone who did it before?  Thanks.
1517284667
vÍnce
Pro
Sheet Author
Not sure if this will help.  Pro users can use a custom sheet that includes access to an online editor with multiple tabs for code editing (html, css, translation, and preview).  In the past when I've helped in creating a translation for a sheet, I simply load the the alternate language's translation json into the translation tab, save and open the game to view/test the changes.  Anything that isn't translated shows up as red bracketed text.
1517307876

Edited 1517307896
Natha
KS Backer
Sheet Author
API Scripter
Translation on the website and on sheets are two distinct activities and don't use the same set of tools. As Vince said, to translate and test a sheet, you have to have access to a pro account, set a (new) campaign in custom sheet mode, and use the files found on the  official github repo for the specific sheet. You  have then to translate the terms in the tranlastion tab / save / reload the campaign / test. When done, save the result in a json file named after the language (ex:"es.json") and you'll have to submit a pull request with this file on the github repo.
Natha said: Translation on the website and on sheets are two distinct activities and don't use the same set of tools. As Vince said, to translate and test a sheet, you have to have access to a pro account, set a (new) campaign in custom sheet mode, and use the files found on the  official github repo for the specific sheet. You  have then to translate the terms in the tranlastion tab / save / reload the campaign / test. When done, save the result in a json file named after the language (ex:"es.json") and you'll have to submit a pull request with this file on the github repo. Thanks, the sheet editor has a pro account and it's helping me with the upload of the files. I am helping him with the preparation of the sheet for translation. Can he upload a "pt.js" file to the same directory as the translation.js and I will see the translated sheet (if my account is in portuguese) in the test campaign? Or do I have to have a pro account to be able to test the translated sheet?
1517881865

Edited 1517882103
vÍnce
Pro
Sheet Author
I believe that you can just log into the game where the pt.json is being used in place of the default language, no Pro required, and you will see the translated text.  In the past I created two test games, one in English and the other in the language of the person helping with translation.  There was a lot of trial and error to get the translation acceptable.  Fun experience.
Vince said: I believe that you can just log into the game where the pt.json is being used in place of the default language, no Pro required, and you will see the translated text.  In the past I created two test games, one in English and the other in the language of the person helping with translation.  There was a lot of trial and error to get the translation acceptable.  Fun experience. Yes, Vince! We managed to do that. Thanks! Now it's time for the translation of the rolltemplates, any tips? :)
1517930303

Edited 1517930437
vÍnce
Pro
Sheet Author
The text within the roll templates can be handled just like you do in the rest of the sheet by including the&nbsp; i18n info ie&nbsp;&lt;span data-i18n="foo"&gt;Foo&lt;/span&gt; Attributes included from button rolls and such need to call the translation a little differntly ie ^{@{foo}} also can be used for text {{^{foo}=@{something}}} more here:&nbsp; <a href="https://wiki.roll20.net/Character_Sheet_i18n#RollT" rel="nofollow">https://wiki.roll20.net/Character_Sheet_i18n#RollT</a>...
1518000246
Natha
KS Backer
Sheet Author
API Scripter
Felipe F. said: Now it's time for the translation of the rolltemplates, any tips? :) Unless it has changed recently (or a trick unknown to me), one drawback: queries in rolls/macro can't be translated. This won't work: ?{^{ask-bonus}|0}
1518559635

Edited 1518559699
Dana Lexa
Sheet Author
For those you will have to use a Sheet Worker and some javascript to create an attribute, then use the attribute in the roll. For example, &lt;script type="text/worker"&gt; on("sheet:opened", function(eventInfo){ &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; setAttrs({ &nbsp; &nbsp; &nbsp; &nbsp; bonusmacro: "?{" + getTranslationByKey("ask-bonus") +"|0}" &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }); &lt;/script&gt; Then, in the HTML, &lt;span style="display: none" data-i18n="ask-bonus"&gt;What is your bonus?&lt;/span&gt; &lt;button type='roll' value='[[d20 + @{bonusmacro}]]' &gt;&lt;/button&gt; The "span" in the example isn't necessary to run, but without it, "i18nOutput" will not include it in the default translation file, so that key will have to be added manually.
1518565650

Edited 1518565860
vÍnce
Pro
Sheet Author
Thanks for the demo! That should be added to the wiki...&nbsp; <a href="https://wiki.roll20.net/Character_Sheet_i18n" rel="nofollow">https://wiki.roll20.net/Character_Sheet_i18n</a>
Good idea! I added examples for just substituting a single piece of text, and complex macros with several pieces of text.
This was very helpful. You should update the final steps too. Upload the translation.json and language.json, the language codes, etc. This part was very confusing, it feels incomplete. I've even wait a few weeks to become a translator in roll20, because i saw somewhere that i needed it.
I don't know how any of that works, only the code side, so if you figure out anything that's missing from the wiki, you may be the best person to add it.
Vince said: Someone has already added your example to the wiki; <a href="https://wiki.roll20.net/Character_Sheet_i18n#Roll_" rel="nofollow">https://wiki.roll20.net/Character_Sheet_i18n#Roll_</a>... ;-P Yes... I did. I'm responding to Felipe's request that more information be added about the translation files and language codes.
1519666179
vÍnce
Pro
Sheet Author
my bad