summaryrefslogtreecommitdiff
path: root/strgen
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-11-02 23:31:04 +0000
committerDarkvater <Darkvater@openttd.org>2005-11-02 23:31:04 +0000
commit1681c231d6bbae8704a5fc7b8ef4996728122b46 (patch)
tree9fb6aee9e2cf2eade05300265f2ebc27382f85a2 /strgen
parent7a2f72d3fca1dcc3cd318126795280dbf1e7b4c8 (diff)
downloadopenttd-1681c231d6bbae8704a5fc7b8ef4996728122b46.tar.xz
(svn r3122) - Fix (regression): recent change to strgen which 'fixed' all strings with wrong plural forms. Thanks for glx for pointing this out (after I changed his original patch which was correct..whohoo braindeadness; here I come)
Diffstat (limited to 'strgen')
-rw-r--r--strgen/strgen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/strgen/strgen.c b/strgen/strgen.c
index 3c07931eb..900ce6d7c 100644
--- a/strgen/strgen.c
+++ b/strgen/strgen.c
@@ -54,7 +54,7 @@ typedef struct Case {
struct Case *next;
} Case;
-static bool _masterlang;
+static bool _translated;
static const char* _file = "(unknown file)";
static int _cur_line;
static int _errors, _warnings;
@@ -332,7 +332,7 @@ static void EmitPlural(char *buf, int value)
Fatal("%s: No plural words", _cur_ident);
if (_plural_form_counts[_lang_pluralform] != nw)
- if (_masterlang) {
+ if (_translated) {
Fatal("%s: Invalid number of plural forms. Expecting %d, found %d.", _cur_ident,
_plural_form_counts[_lang_pluralform], nw);
} else {
@@ -1157,6 +1157,8 @@ static void WriteLangfile(const char *filename, int show_todo)
cmdp = ls->english;
}
+ _translated = !(cmdp == ls->english);
+
if (casep) {
Case *c;
int num;
@@ -1224,7 +1226,6 @@ int CDECL main(int argc, char* argv[])
if (argc == 1) {
- _masterlang = true;
// parse master file
ParseFile("lang/english.txt", true);
MakeHashOfStrings();
@@ -1236,7 +1237,6 @@ int CDECL main(int argc, char* argv[])
WriteStringsH("table/strings.h");
} else if (argc == 2) {
- _masterlang = false;
ParseFile("lang/english.txt", true);
MakeHashOfStrings();
ParseFile(argv[1], false);