How do I search all StringTables for a string/partial string? When I see the localized text in the client, I could use the Widget Reflector but honestly that can be a slow process some times.
Is there a way to export all StringTables to CSV?
or is there a way to turn off localization in the client, so that it shows the string table key or string table name?
Figured out you could export the StringTables as CSV, is there an easier way of doing this that I don’t know about?
#include "Internationalization/StringTableCore.h"
#include "Internationalization/StringTableRegistry.h"
#include "Kismet/KismetStringTableLibrary.h"
IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile();
if (!FileManager.DirectoryExists(TEXT("StringTables")) && !FileManager.CreateDirectory(TEXT("StringTables")))
{
UE_LOG(LogTemp, Warning, TEXT("Failed to create StringTables directory"));
}
TArray<FName> stringTableIDs = UKismetStringTableLibrary::GetRegisteredStringTables();
for (const auto& stringTableId : stringTableIDs)
{
FString stringTableNamePath = stringTableId.ToString();
FString stringTableName;
stringTableNamePath.Split(TEXT("."), nullptr, &stringTableName);
FStringTableConstPtr StringTable = FStringTableRegistry::Get().FindStringTable(stringTableId);
if (StringTable.IsValid())
{
FString csvFile = FString::Format(TEXT("StringTables/{0}.csv"), { stringTableName });
StringTable->ExportStrings(csvFile);
}
}