Localization Manager - automating "Gather, Export, Import" steps

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 from en.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 in StartupModule
  • Added a menu item in-editor that says “Update PO files” - it goes through generated *.po files and replaces msgstr 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 :joy: 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

As a side note, I’ve found the “Automation” area of Localization Tools in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community, but I could not find examples of implementing LocalizationProvider - I was lacking at least a single, very simple, but still step-by-step instruction/example, like "Let’s build a minimal super-basic LocalizationProvider that just imports everything from en.csv, de.csv, fr.csv files.

I guess I could read full code of XLocLocalizationProvider, but I felt that without any documentation of building it + not very extensive docs on UAT itself - it would be longer than a solution I described in the first post.

Maybe I’m wrong and should dive deeper in that direction.