Our team is trying to implement a utility for finding (and also fixing broken) localization string keys in Unreal assets. We are using FText with StringTable entry references.
One path we tried was to leverage the GatherText commandlet but it appears to ignore StringTable entries. Is there a way to include StringTable entry references as part of the gathering step?
Is there some other way to find all references to a specific StringTable entry efficiently?
Thanks!
[Attachment Removed]
Steps to Reproduce[Attachment Removed]
Hi,
You should be seeing StringTable entries when you run GatherText, but we wouldn’t expect the keys themselves to be included (since you wouldn’t want to translate those). Does that match what you’re seeing? You’ll need to check Gather from Packages and add the directory as an include path, but I’d be concerned if the value strings weren’t gathered.
Normally I’d recommend taking a look at the Asset Search plugin for tracking down specific string references, though it looks like it doesn’t pick up the string table keys so that might not be helpful here. Likewise, gathering and exporting text (to generate a PO file) will associate localization strings back to their source asset, but with string tables you’ll still be missing the connection between the string table asset and the place where that text is bound.
As for actual solutions, the TranslationPicker console command will bring up a window that you can use to hover over localized strings in your content and inspect the source, so that might help trace a broken string back to it’s source table. The tool hasn’t been touched in a while and it doesn’t look like the Edit Translation window is particularly useful for string table entries, but this will at least let you quickly correlate a broken string back to it’s source asset during testing.
For a full scan of all uses of a given key, you’ll likely need to write a commandlet that uses FTextInspector to iterate every FText in your project. I’ve attached a sample commandlet that seemed to work well in a fairly minimal test project, though I haven’t tested it at production scale. Hopefully you can use that as a starting point!
Best,
Cody
[Attachment Removed]
Thanks Cody! We did end up writing a commandlet that uses FTextInspector to iterate over all the FText to build a cache of references. Good to get confirmation we were on the right track!
[Attachment Removed]