For various reasons we’re storing data about certain assets outside of Unreal, but we’d like to utilize Unreal’s localization tools for them, as there’s no point trying to invent a replacement for FText and ICU just for these things.
What I would like to know is if it’s possible to generate or hand-build either localization format (.archive, .manifest, .po) from outside Unreal and have it generate a .locres file, that can then be used for referencing localized strings programatically.
As an example, an asset may have a DisplayName property, keyed in our system by “data/133/DisplayName”, which is generated based on the type definition and the ID (133) of the property. I’ve been playing around with manually putting these into .archive, .manifest, and .po files, trying to get a .locres file out of it, so far without success. (Regular GatherText extraction from code and assets work, so I’m pretty sure the overall setup is right)
I’m also curious if I’ll be able to initialize an FText property with this key in runtime and have it look up the correct text in the .locres file, once I’ve gotten it generated. I know there’s no such constructor for FText, but you get what I’m after.
UPROPERTY()
FText DisplayName;
int id = myData.ID;
DisplayName = FText::FromString(FString::Format(TEXT("data/%d/DisplayName"), id));
Cheers,