One common cause of unstable localization keys is iteratively importing raw strings from a CSV file into a Data Table, as this causes a new key to be generated after each import. A solution for this is to assign the imported text a deterministic key post-import by overriding the
OnPostDataImport function on your row struct, and calling
FText::ChangeKey to assign the new key.
Typically we use the data table name as the namespace, and a combination of the row name and property name as the key. For example:
void FMyTableRow::OnPostDataImport(const UDataTable* InDataTable, const FName InRowName, TArray& OutCollectedImportProblems)
MyTextProperty = FText::ChangeKey(
FString::Printf(TEXT("%s_%s"), *InRowName.ToString(), GET_MEMBER_NAME_STRING_CHECKED(FMyTableRow, MyTextProperty)),
#endif // WITH_EDITOR
As of the 4.22 release, deterministic keys are already applied to any raw strings imported into a Data Table, but you can still override
OnPostDataImport if you need custom keying behavior.