Author Topic: NOX(s) macro  (Read 9210 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Actually, if the language is English, the text from tstrings.tbl isn't used at all (although the text from strings.tbl still is); the string preceding the index is used instead. This is true in both retail and current SCP builds (yes, I tested it just now).

:wtf:

Well, phooey.  I tested this back in the day for a strings.tbl entry and assumed tstrings.tbl handled it the same way.  A foolish inconsistency is the hobgoblin of code maintainers.

Quote
I don't quite understand what you're getting at here. A typical translation is going to be different from the original anyway; how would changing such a translation suddenly cause string lookup to start failing?

In other words, if you use the untranslated string as a string lookup, you're relying on something which is not actually the intended key of the table.  If you are using the untranslated string to obtain the XSTR index using the translated English string, this relies on the equivalence of the untranslated and English strings.

Quote
How is storing the original string the wrong approach if you're also storing the translated string (and you've properly implemented the functions needed to deal with this)?

See the previous paragraph.  It's not clear to me how you would link the untranslated string with a translated string (of any sort) without using the XSTR index.  Your proposed dual-string struct seems like a transformation of the problem rather than a solution to it.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Storing the index isn't the best idea either though. While it works fine during a single run of the code, if someone changes the tables it can result in all the indexes being wrong. From a quick glance at the pilot code I suspect that is what would happen if you insert an entry to species.tbl rather than appending to it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
The best idea that I've come across is to have a string identifier instead of a numeric identifier, but have that string be a short token rather than the entire untranslated string.  Then the English string would be a "translation" just like any other, but there would be no risk of mismatch.  This is the strategy Java uses in its language bundles, and consequently is what is used in the FSO Installer.

(It does have the disadvantage that the string is not immediately visible when maintaining the code.)