-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax parsing rules for CSV translation files #82491
base: master
Are you sure you want to change the base?
Relax parsing rules for CSV translation files #82491
Conversation
There are no chances of adding unit tests for this? Because this can totally be a thing to be unit tested without too much trouble. |
Good idea, I'll add some tests! |
adfadde
to
85a6d6d
Compare
add translation tests
85a6d6d
to
3358c6c
Compare
Added tests for:
I also moved the existing csv import test to this new file. I don't think it belongs in the test_translation.h file. There didn't seem to be much precedent for these tests, as none of the other importers have tests. It seemed like it might be a good idea to have a folder for things that test pure editor code, as opposed to being shoved into existing files with a bunch of TOOLS_ENABLED conditionals. Then the test files can just be included with a single conditional. In any case, let me know if there's a better way to organize this and I'll update as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning behind this makes sense to me.
However, recent commits have added uses of ERR_CONTINUE_MSG
instead of using WARN_PRINT
. When you have time, could you rebase this PR on master
and change your added code to use ERR_CONTINUE_MSG
instead? Note that 4.3's release is imminent, so you don't have to rush for this as this PR is now targeting 4.4 (although it could be cherry-picked to 4.3.x later).
Fixes #82002
This PR relaxes the parsing rules in the CSV translation importer, so that CSVs that are not properly formatted don't fail the import. This allows users to change the delimiter options (or set the mode to "keep").
More specifically, this would no longer throw an error for:
Testing this is a bit tedious at the moment due a crash in import_dock.cpp when reimporting files that don't return a resource from
ResourceLoader::load
. Fix for that is up here: #82490