I would like to share an approach I used in a recent project which can save a lot of time, that some users might not be aware of. If you are working with .tmx files for mapp View visualizations, you are probably writing the texts in one language and leaving the other languages blank. Using AI, for example ChatGPT, you can easily translate whole .tmx files at once into multiple languages, and add new languages dynamically if needed. You can simply upload an existing .tmx file directly to ChatGPT.
Here is an example for a prompt:
Prompt for AI
You are an expert in XML processing and localization for industrial automation systems. Take the attached .tmx file used in PLC programming, and do the following:
- Identify all entries in the file.
- For each , detect existing language nodes and their text inside .
- Use any existing translation (prioritize English, if available) as the source to generate translations into the following additional languages:
- de (German)
- fr (French)
- es (Spanish)
- pl (Polish)
- For each missing language, append a new …translation… inside the correct while keeping the order and formatting intact! Add new lines for each tag, but no empty spaces and no comments.
- Preserve:
- The exact formatting, indentation, and structure of the original XML.
- All existing header metadata and tags.
- The UTF-8 encoding and TMX version declaration.
The resulting .tmx file must only include accurate industrial machine control terminology. Avoid overly generic translations.
Provide the updated .tmx content as valid XML, available for downloading. Answer only with the downloadable file. Preserve the file name.
The result will hopefully look something like this:
(Left side - original file, right side - created file)
This will generate a downloadable file that you can replace the old one with (always save a backup - there can be errors!). I got the best results using ChatGPT model o3. But I’m sure others could work fine just as well.