summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2007-01-18 15:27:57 +0000
committerDarkvater <darkvater@openttd.org>2007-01-18 15:27:57 +0000
commit4de91346e91c41bac23533665b4c39429df29e78 (patch)
treedbc28647be2f595d0c6e671e00725329a23a78f9 /src/strgen
parent982c451a8edceab383ba6247408c3387cef5ccfc (diff)
downloadopenttd-4de91346e91c41bac23533665b4c39429df29e78.tar.xz
(svn r8253) -Codechange: Be more strict about language generation and fail any languages not having the mandatory ##name, ##ownname and ##isocode pragma's.
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 9b6ae5102..c837b3664 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -913,12 +913,12 @@ static void ParseFile(const char *file, bool english)
_file = file;
- // For each new file we parse, reset the genders.
+ /* For each new file we parse, reset the genders, and language codes */
_numgenders = 0;
+ _lang_name[0] = _lang_ownname[0] = _lang_isocode[0] = '\0';
// TODO:!! We can't reset the cases. In case the translated strings
// derive some strings from english....
-
in = fopen(file, "r");
if (in == NULL) fatal("Cannot open file");
_cur_line = 1;
@@ -928,6 +928,10 @@ static void ParseFile(const char *file, bool english)
_cur_line++;
}
fclose(in);
+
+ if (StrEmpty(_lang_name) || StrEmpty(_lang_ownname) || StrEmpty(_lang_isocode)) {
+ fatal("Language must include ##name, ##ownname and ##isocode");
+ }
}