|
@@ -1008,45 +1008,45 @@ void LanguageWriter::WriteLang(const Str
|
|
|
} else {
|
|
|
casep = NULL;
|
|
|
cmdp = ls->english;
|
|
|
}
|
|
|
|
|
|
_translated = cmdp != ls->english;
|
|
|
|
|
|
if (casep != NULL) {
|
|
|
const Case *c;
|
|
|
uint num;
|
|
|
|
|
|
/* Need to output a case-switch.
|
|
|
* It has this format
|
|
|
* <0x9E> <NUM CASES> <CASE1> <LEN1> <STRING1> <CASE2> <LEN2> <STRING2> <CASE3> <LEN3> <STRING3> <STRINGDEFAULT>
|
|
|
* Each LEN is printed using 2 bytes in big endian order. */
|
|
|
buffer.AppendUtf8(SCC_SWITCH_CASE);
|
|
|
/* Count the number of cases */
|
|
|
for (num = 0, c = casep; c; c = c->next) num++;
|
|
|
buffer.AppendByte(num);
|
|
|
|
|
|
/* Write each case */
|
|
|
for (c = casep; c != NULL; c = c->next) {
|
|
|
buffer.AppendByte(c->caseidx);
|
|
|
/* Make some space for the 16-bit length */
|
|
|
uint pos = buffer.Length();
|
|
|
uint pos = buffer.size();
|
|
|
buffer.AppendByte(0);
|
|
|
buffer.AppendByte(0);
|
|
|
/* Write string */
|
|
|
PutCommandString(&buffer, c->string);
|
|
|
buffer.AppendByte(0); // terminate with a zero
|
|
|
/* Fill in the length */
|
|
|
uint size = buffer.Length() - (pos + 2);
|
|
|
uint size = buffer.size() - (pos + 2);
|
|
|
buffer[pos + 0] = GB(size, 8, 8);
|
|
|
buffer[pos + 1] = GB(size, 0, 8);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (cmdp != NULL) PutCommandString(&buffer, cmdp);
|
|
|
|
|
|
this->WriteLength(buffer.Length());
|
|
|
this->Write(buffer.Begin(), buffer.Length());
|
|
|
this->WriteLength(buffer.size());
|
|
|
this->Write(buffer.Begin(), buffer.size());
|
|
|
buffer.clear();
|
|
|
}
|
|
|
}
|
|
|
}
|