kess wrote:There is a table of strings (one set per language), e. g. for English: "I like $NAME. {$NAME?M=He;F=She} is nice."
Question: Is the information "M" or "F" stored along with the name in another table then?
The M or F would be embedded in the string or stringtable entry that is passed in as the value of $NAME. So there could be another stringtable entry like this:
RULER12
Bill(M)
Where the first line is the internal code name for a string, and the second is the actual stringtable entry. Both of these appear in the stringtable file... each with the code name followed by the (translated) human readable string that the game displays.
This value of the stringable entry above would be passed, by the game code, into the string
STATEMENT
I like $NAME. {$NAME?M=He;F=She} is nice.
And the game would then render the string STATEMENT to the screen as
I like Bill. He is nice.
It would know to pick "He" because the passed string RULER12 contains the flag M, which it is set to check for.
Due to the wealth of grammatical/syntactical/phonological/... categories needed to be considered in different languages, this may be extremely huge and complex.
Or is the "M"/"F" information stored for each language? Then it might not be so huge and complex (especially if FO is going to be translated into non-Germanic or non-IE languages). Though how would this be/is this solved?
The translator can add and remove flags (like M or F) as needed due to the grammtical rules of the langauge being translated to. They do this by putting the flags and tests for the flags right into the stringtable entries they're translating.
It's not really possible to encode all of this type of information in a way that the game code itself can use to synthesize strings... this is far too complicated and there are far too many cases and the programmers aren't linguists so don't even know what all the rules for various languages could be, and certainly don't have time to implement them all. This way, the translator, who actually knows the language, can do that work.
Question: How to put text just next to the string? If $NAME = "Bill":
"$NAMEAn" --> "BillAn" (this may be desirable in some languages)
"$NAME An" --> "Bill An" (the normal way, as above)
STATEMENT
$NAME{$NAME?FLAG1=An;FLAG2= An}
ONENAME
Bill(FLAG1)
OTHERNAME
Bill(FLAG2)
If the string string ONENAME was passed into STATEMENT, the check would find FLAG1 and render the "An" without a space. If the string OTHERNAME was passed into statement, the check would find FLAG2 and render " An" with a space. (The exact syntax of this isn't nailed down obviously... there might be "" quotes around the "An" and " An" substrings or somesuch)