(scrTranslate) and (scrSetDescTranslate)

Freeform discussion about anything related to modding Transcendence.
Post Reply
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

Hey folk, it's been a while. I had a pretty bad year and now I want to try to get back to Transcendence.

I noticed some changes which I don't quite understand.

What does (scrTranslate) and (scrSetDescTranslate) do? They sound like I could use them for my mod.

Also thanks to George for <Language>! This will make my work so much easier.
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Glad to have you back!

I've been slowly (very slowly) adding more support for translation. The work is NOT done yet, but I want to describe how I expect it to work in the future:

1. Eventually, every piece of user-visible text will be contained in a <Language> block. This is probably the biggest piece of work remaining. All new code that I write separates text into a <Language> block, but there is lots of old code that needs to be converted.

2. Every type (ship classes, dock screens, etc.) supports a <Language> block. Eventually you will be able to override just the <Language> block part of any type. For example, eventually you'll be able to do something like this:

Code: Select all

<DockScreenOverride unid="&dsRPGCommoditiesExchange;">
   <Language locale="de">
      <Text ID="myText">...</Text>
   </Language>
</DockScreenOverride>
Notice that every piece of text has an ID. This ID is unique within a type, but you need both the text ID and the type UNID to uniquely identify a piece of text in a <Language> block.

3. When code needs to access a piece of text, it uses one of the many translate functions:

typTranslate: Looks up the text ID in the type's <Language> block.
objTranslate: Looks up the text ID in the object's type's <Language> block. This is just a short-cut for (typTranslate (objGetType obj) ...)
msnTranslate: Same as objTranslate, but works on mission objects.
scrTranslate: Looks up the text ID in the dock screen's type's <Language> block. If not found, it looks in the station object's type's block.
scrSetDescTranslate: This is a short-cut to scrTranslate that sets the translated text to the dock screen description.

As I said, I haven't done all the work to implement this yet, but this is the direction that I'm heading.
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

This look nice. I think I'm gonna finish translating v1.3 and then convert it sometimes later into a better supporting version of the game.

George, you are motivating.
Post Reply