The most dangerous operation is a bulk text edit, because unit names and on-screen text so often contain the same words.
Never change a unit name. Triggers reference units by name, so a single changed character stops the map compiling. Translation and typo fixes must apply only to the strings inside DisplayText.
So instead of a global find-and-replace, you constrain the edit syntactically: match only the string inside a DisplayText call and rewrite only that.
re.sub(r'DisplayText\("((?:[^"\\]|\\.)*)"', rewrite_body, text)Then verify. Count the occurrences of each unit name and confirm they are unchanged, and diff the set of quoted strings outside DisplayText against a backup. “Looks right” becomes “does not compile” later.
When you ask for a translation or wording pass, ask for a programmatic comparison of every DisplayText rather than a read-through. A selective read always misses things.
