summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-08-21 19:21:38 +0000
committerrubidium <rubidium@openttd.org>2011-08-21 19:21:38 +0000
commit525e2c9e73ecab8913d4eafc6685d89e1653d151 (patch)
tree84ca4031ce61c9b040d1aae0a152bb5da5ea35a6 /src/strgen
parentf6b0561cd86f363c93b64817f26e3ed7f5b1b688 (diff)
downloadopenttd-525e2c9e73ecab8913d4eafc6685d89e1653d151.tar.xz
(svn r22806) -Codechange: store the number of untranslated strings in the language file
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index d3b86c4ec..9dd5b6fb6 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -1061,10 +1061,16 @@ static void WriteLangfile(const char *filename)
in_use[i] = n;
_lang.offsets[i] = TO_LE16(n);
+
+ for (uint j = 0; j != in_use[i]; j++) {
+ const LangString *ls = _strings[(i << 11) + j];
+ if (ls != NULL && ls->translated == NULL) _lang.missing++;
+ }
}
_lang.ident = TO_LE32(LanguagePackHeader::IDENT);
_lang.version = TO_LE32(_hash);
+ _lang.missing = TO_LE16(_lang.missing);
_lang.winlangid = TO_LE16(_lang.winlangid);
fwrite(&_lang, sizeof(_lang), 1, _output_file);