mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 23:26:34 +00:00
(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)
This commit is contained in:
parent
b850806205
commit
9d786d3e53
@ -54,7 +54,7 @@ typedef struct Case {
|
|||||||
struct Case *next;
|
struct Case *next;
|
||||||
} Case;
|
} Case;
|
||||||
|
|
||||||
static bool _masterlang;
|
static bool _translated;
|
||||||
static const char* _file = "(unknown file)";
|
static const char* _file = "(unknown file)";
|
||||||
static int _cur_line;
|
static int _cur_line;
|
||||||
static int _errors, _warnings;
|
static int _errors, _warnings;
|
||||||
@ -332,7 +332,7 @@ static void EmitPlural(char *buf, int value)
|
|||||||
Fatal("%s: No plural words", _cur_ident);
|
Fatal("%s: No plural words", _cur_ident);
|
||||||
|
|
||||||
if (_plural_form_counts[_lang_pluralform] != nw)
|
if (_plural_form_counts[_lang_pluralform] != nw)
|
||||||
if (_masterlang) {
|
if (_translated) {
|
||||||
Fatal("%s: Invalid number of plural forms. Expecting %d, found %d.", _cur_ident,
|
Fatal("%s: Invalid number of plural forms. Expecting %d, found %d.", _cur_ident,
|
||||||
_plural_form_counts[_lang_pluralform], nw);
|
_plural_form_counts[_lang_pluralform], nw);
|
||||||
} else {
|
} else {
|
||||||
@ -1157,6 +1157,8 @@ static void WriteLangfile(const char *filename, int show_todo)
|
|||||||
cmdp = ls->english;
|
cmdp = ls->english;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_translated = !(cmdp == ls->english);
|
||||||
|
|
||||||
if (casep) {
|
if (casep) {
|
||||||
Case *c;
|
Case *c;
|
||||||
int num;
|
int num;
|
||||||
@ -1224,7 +1226,6 @@ int CDECL main(int argc, char* argv[])
|
|||||||
|
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
_masterlang = true;
|
|
||||||
// parse master file
|
// parse master file
|
||||||
ParseFile("lang/english.txt", true);
|
ParseFile("lang/english.txt", true);
|
||||||
MakeHashOfStrings();
|
MakeHashOfStrings();
|
||||||
@ -1236,7 +1237,6 @@ int CDECL main(int argc, char* argv[])
|
|||||||
WriteStringsH("table/strings.h");
|
WriteStringsH("table/strings.h");
|
||||||
|
|
||||||
} else if (argc == 2) {
|
} else if (argc == 2) {
|
||||||
_masterlang = false;
|
|
||||||
ParseFile("lang/english.txt", true);
|
ParseFile("lang/english.txt", true);
|
||||||
MakeHashOfStrings();
|
MakeHashOfStrings();
|
||||||
ParseFile(argv[1], false);
|
ParseFile(argv[1], false);
|
||||||
|
Loading…
Reference in New Issue
Block a user