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.
(scrTranslate) and (scrSetDescTranslate)
-
- 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:
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.
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>
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.