Hey folks,
I’m doing translations via external services – mostly AI-based services. I’m not using “author-at-source” techniques, only using StringTables everywhere.
When I want a new translation - I’m first adding a key to the en.json
file that has the following structure (simplified example):
{
"main_menu": {
"new_game": "New game",
"load_game": "Load game",
"settings": "Settings",
"quit": "Quit",
"new_key": "Something"
}
}
and then do the same for de.json
, fr.json
and similar, after processing the original en.json
keys with OpenAI API or even just throwing into ChatGPT or similar.
I’ve created:
- JSON → .csv converter to generate
en.csv
fromen.json
(I don’t like *.csv for this task - nesting prefixes is repetitive) - LOCTABLE_FROMFILE_GAME(“Localization/en.csv”, “Locales”, “Localization/en.csv”) on the generated
*.csv
inStartupModule
- Added a menu item in-editor that says “Update PO files” - it goes through generated
*.po
files and replacesmsgstr
values with values from translation files
Question: how can I automate the steps of clicking “Gather”, “Export text” and “Import text” from code? Is there any kind of C++ solution where I can trigger this from code? Any amount of hacks are acceptable and welcome Even if it’s using some internals that might change in next UE version.
Because otherwise I have a fully automated code-based pipeline for everything except clicking “Gather”, “Export Text” and “Import Text”.
Thanks