T4 Text Templating Script
T4 Template script automatically updates the localization files as code evolves.
Download Lexical.Localization.Tool.exe and add it into the C# project folder.
Create new text template file "scanner.tt" into the C# project.
Paste the following snippet into the .tt file.
"output extensions" determines file format. Supported formats are .json, .resx, .xml, .resources, .ini.
<#@ output extension=".ini"#>
Click on the "scanner.tt" and select "Run custom tool."
If everything went as expected, two new files are added into the project scanner.ini and scanner.ini.log.
The generated file now contains the inlined strings that are read from the code.
These generated language strings can now be passed to translators and then added back to the project.
For the example the output would be:
Section:Key = Success
[Culture:fi]
Section:Key = Onnistui
[Culture:sv]
Section:Key = Det funkar
If there was an issue with the T4, the script can be debugged.