mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Fix crash when columns are skipped in csv translation
This commit is contained in:
parent
fe01776f05
commit
f98d552214
@ -122,11 +122,12 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
|
||||
if (!key.is_empty()) {
|
||||
ERR_CONTINUE_MSG(line.size() != locales.size() + (int)skipped_locales.size() + 1, vformat("Error importing CSV translation: expected %d locale(s), but the '%s' key has %d locale(s).", locales.size(), key, line.size() - 1));
|
||||
|
||||
int write_index = 0; // Keep track of translations written in case some locales are skipped.
|
||||
for (int i = 1; i < line.size(); i++) {
|
||||
if (skipped_locales.has(i)) {
|
||||
continue;
|
||||
}
|
||||
translations.write[i - 1]->add_message(key, line[i].c_unescape());
|
||||
translations.write[write_index++]->add_message(key, line[i].c_unescape());
|
||||
}
|
||||
}
|
||||
} while (!f->eof_reached());
|
||||
|
Loading…
Reference in New Issue
Block a user