I want to localize strings in c++ using string table assets. I have read the documentation, yet there remains some confusion.
I don’t use the macros LOCTEXT / NSLOCTEXT since they are macros and don’t work with variable input.
This does not localize anything if the table is not loaded:
FText OutText = FText();
FText::FindText(InNameSpace, InKey, OutText);
// This does not localize anything from the namespace alone, apparently you need the entire asset path, which makes no sense because we specifically specify a namespace for a string table. I absolutely want to avoid hardcoding an asset path or having to configure one in the editor:
const FText Localized = FText::FromStringTable(InNameSpace, InKey, EStringTableLoadingPolicy::FindOrLoad);
The question is: How do I, in a oneliner, localize a string from a string table by namespace and key alone, which does not fail?
FText::FromStringTable:
LogStringTable: Warning: Failed to find string table entry for 'MainMenu' 'Value_Large'. Did you forget to add a string table redirector?
I already checked the namespace and keys exist.
There’s nothing about it here:
To be sure, referenced the directory directly containing the string tables:
UCorePluginEditorUtils::AddAdditionalAssetDirectoryToCook(TEXT(“/CorePlugin/Localization/Text”));
To be double sure, referenced the string table on an FText node on a used blueprint.
Absolutely nothing. What the??
Related, same problem: