On a different forum (boardgamegeek.com for those interested) I asked yesterday if there was a way through a RegEx search&replace to remove all XML tags besides "defname", "label" and "description" from a text file - to be able to see what we translators need to see
And voila! A helpful fella replied today with the below RegEx code that I successfully tried on one of the XMLs from the "Defs" folder.
The result is just the lines containing these tags (and the text within them) are kept and all other lines are deleted from the file. In this way you do not need to scroll through the file and search meticulously for all defnames, labels and descriptions and instead have it all neatly one after the other. I left the "defname" in there for string reference in the resulting translated file.
This does not change the format of the Defs file into the "language" file, so it is more for reference and backwards control for changes between versions (after which you can edit your translated files).
I am using Notepad++ and it works there, so not sure if it works in ALL RegEx-enabled utilities.
Search:
(?s)(</label>|</description>|</defname>)(.*?)(<label>|<description>|<defname>)
Replace with:
\1\r\3
And voila! A helpful fella replied today with the below RegEx code that I successfully tried on one of the XMLs from the "Defs" folder.
The result is just the lines containing these tags (and the text within them) are kept and all other lines are deleted from the file. In this way you do not need to scroll through the file and search meticulously for all defnames, labels and descriptions and instead have it all neatly one after the other. I left the "defname" in there for string reference in the resulting translated file.
This does not change the format of the Defs file into the "language" file, so it is more for reference and backwards control for changes between versions (after which you can edit your translated files).
I am using Notepad++ and it works there, so not sure if it works in ALL RegEx-enabled utilities.
Search:
(?s)(</label>|</description>|</defname>)(.*?)(<label>|<description>|<defname>)
Replace with:
\1\r\3