mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r8253) -Codechange: Be more strict about language generation and fail any languages not having the mandatory ##name, ##ownname and ##isocode pragma's.
This commit is contained in:
parent
4ad7f99e82
commit
6b3e59474f
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user