-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Minetest version
Minetest 5.9.0-dev
Summary
The script uses regex to parse translation lines, which is incorrect. Take the following example:
Something@@= Something@@
The script will ignore this line as it thinks the @
is escaping the =
, but it is actually adding @
. Another issue: the script ignores invalid lines without warning!
The script also assumes that a translation is only ever on one line. This is not the case, given @\n
:
A @n newline = Une @
nouvelle ligne
Steps to reproduce
I've written my own Python .tr file parser with unit tests here. Unit tests should be added to mod_translation_updater.py, it's unacceptable to have a parser without tests.
My implemention throws a lot of information away (ie: comments) so couldn't be taken directly, but inspiration can be taken from the approach (which is based on the .cpp code)