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

Character Sheet Guide - Translations

November 20 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

I'm about to start work on the next step of the character sheet guide (seen here: https://cybersphere.me/roll20-sheet-author-master-list/).

My most recent guide chaper was on Custom Roll Parsing, and I've had a few people thank me on how much clearer it made that feature. Now it's Translations turn. The page on the wiki is complete, but not that easy to follow. https://wiki.roll20.net/Character_Sheet_Translation

What do you think I should cover? What aspects of Translations need to  be explained for common use?

November 21 (1 year ago)

Edited November 21 (1 year ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Somewhere I wrote up an in depth explanation about how data-i18n-vars work. I'll see if I can find that in my list of forum replies.

EDIT:

Ah, actually, I planned ahead for once and the write up is actually what's in the wiki.

November 21 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

Hehe, great, I'll look over it.

November 21 (1 year ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

The only other thing I'd recommend for translations is that casing should not be done in the translation file. This puts styling in the hands of the translators who may or may not case the translation the way you wanted. Casing should instead be done via css with t xt-transform.

November 21 (1 year ago)

Edited November 21 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

Interesting. And yes, relying on other people to interepret the text the way you want them to is iffy.

I haven't done translations before, so any suggestions from people who have are welcomed.

November 21 (1 year ago)
vÍnce
Pro
Sheet Author


Scott C. said:

The only other thing I'd recommend for translations is that casing should not be done in the translation file. This puts styling in the hands of the translators who may or may not case the translation the way you wanted. Casing should instead be done via css with t xt-transform.

Are you saying all values should be lower or upper case?  I just assumed that a translator should "emulate" whatever I entered as the key's value, since I decided how I wanted the text presented.  How should you capitalize, italicize, bold,  certain words in the middle of a long translation?  I've seen translations with simple formatting code inside the value as well...  but I'm guessing that shouldn't be done?


November 21 (1 year ago)
vÍnce
Pro
Sheet Author

I haven't checked in a while, but I believe that Changing Language-Specific Looks based on language is still broken.

November 21 (1 year ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator


vÍnce said:


Scott C. said:

The only other thing I'd recommend for translations is that casing should not be done in the translation file. This puts styling in the hands of the translators who may or may not case the translation the way you wanted. Casing should instead be done via css with t xt-transform.

Are you saying all values should be lower or upper case?  I just assumed that a translator should "emulate" whatever I entered as the key's value, since I decided how I wanted the text presented.  How should you capitalize, italicize, bold,  certain words in the middle of a long translation?  I've seen translations with simple formatting code inside the value as well...  but I'm guessing that shouldn't be done?

I do all lowercase because then I just have to apply the capitalization for my headers or what not. But I also tend to do everything in lowercase on a sheet.


GiGs said:

I haven't done translations before, so any suggestions from people who have are welcomed.

The untranslated text as content of the element is optional in my opinion. I'm not even sure when it would actually show up. I also try to use the English word or phrase as the translation key. This should hopefully make it easier to translate. Exceptions are things like abbreviations that may not make sense out of context, in which case I use a descriptive key:

{
  "strength abbreviation":"str"
}

The other big exception is if I'm going to use the variable replacement. In that case I include a description of what the untranslated indices are in the key:

{
  "{{List number}} unharmed": "{{0}} unharmed"
}

And the final gotcha applies only to projects whose native language isn't English. The translation.json file that you upload to the repo is used as the English translation file. If your project's native language isn't English, you'll need to upload an English version as the translation.json and ask for permission to upload the native language as the appropriate jspn file in the translations directory (I'm hoping roll20 improves this work flow in the near future).

November 21 (1 year ago)

Edited November 21 (1 year ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Oh, and it's probably obvious but translations should be all or nothing (at least if you're starting a new project). Don't translate just a few elements on the sheet. Additionally, it is infinitely easier to just put translations in at the start of coding than it is to add them in later. I HIGHLY recommend just doing your translation keys as you add elements and updating your translation.jspn file as you go. The K-scaffold will actually automate the translation.json creation for you based on the data-i18ns you add to elements.

November 21 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter


Scott C. said:

Oh, and it's probably obvious but translations should be all or nothing (at least if you're starting a new project). Don't translate just a few elements on the sheet.

Oh yeah, thats a great point.


November 21 (1 year ago)

Edited November 21 (1 year ago)
vÍnce
Pro
Sheet Author


GiGs said:


Scott C. said:

Oh, and it's probably obvious but translations should be all or nothing (at least if you're starting a new project). Don't translate just a few elements on the sheet.

Oh yeah, thats a great point.


I mean, who doesn't like a little red text? ;-P




November 21 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

so pretty :)