strgen: Split non-upstream translated strings into separate file
This commit is contained in:
@@ -629,7 +629,12 @@ int CDECL main(int argc, char *argv[])
|
||||
|
||||
const char *translation = replace_pathsep(mgo.argv[i]);
|
||||
const char *file = strrchr(translation, PATHSEPCHAR);
|
||||
FileStringReader translation_reader(data, translation, false, file == nullptr || strcmp(file + 1, "english.txt") != 0);
|
||||
const char *translation2 = nullptr;
|
||||
if (file != nullptr) {
|
||||
mkpath2(pathbuf2, lastof(pathbuf2), src_dir, "extra", file + 1);
|
||||
translation2 = pathbuf2;
|
||||
}
|
||||
FileStringReader translation_reader(data, translation, translation2, false, file == nullptr || strcmp(file + 1, "english.txt") != 0);
|
||||
translation_reader.ParseFile(); // target file
|
||||
if (_errors != 0) return 1;
|
||||
|
||||
|
@@ -796,8 +796,13 @@ void StringReader::HandleString(char *str)
|
||||
}
|
||||
|
||||
if (ent->translated && casep == nullptr) {
|
||||
strgen_error("String name '%s' is used multiple times", str);
|
||||
return;
|
||||
if (this->data.override_mode) {
|
||||
free(ent->translated);
|
||||
ent->translated = nullptr;
|
||||
} else {
|
||||
strgen_error("String name '%s' is used multiple times", str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* make sure that the commands match */
|
||||
|
Reference in New Issue
Block a user