Hello!
Thank you for your answer! I don’t use LOCTABLE_FROMFILE_GAME because I cannot pass variable as macro parameter. Instead of I’m using exactly same code as macro is.
FStringTableRegistry::Get().Internal_LocTableFromFile(*Line, Line, csvFile, FPaths::GameDir());
I create csv file list dynamically outside of Visual Studio and need to use variable. Every String Tables loading correct and I can use then in editor or in game.
So If GatherText commandlet looking for LOCTABLE_FROMFILE_GAME, how to use variable for it ?
Or what is the other way to load dynamically created list of csv files ?
void FImportCsvInGamePlugin::LoadAllStringTables ()
{
FString dirGeneratedStringTables = "Content/Localization/StringTables/";
// Find and load CSV file
FString StringTableListFile = FPaths::GameDir() + *dirGeneratedStringTables + "StringTableList.txt";
TArray<FString> * StringTableList = LoadStringTableFilesList(StringTableListFile);
for (int i = 1; i < StringTableList->Num(); i++) // pass over first line
{
FString Line = (*StringTableList)[i];
FString csvFile = dirGeneratedStringTables + *((*StringTableList)[i]) + ".csv";
//LOCTABLE_FROMFILE_GAME("aaa", kaka, "../Localization/Generated/STestStringTable.csv");
FStringTableRegistry::Get().Internal_LocTableFromFile(*Line, Line, csvFile, FPaths::GameDir());
};
}
TArray * FImportCsvInGamePlugin::LoadStringTableFilesList (FString FNameFullPath)
{
TArray<FString> * FileContent = new TArray<FString>;
if (FPaths::FileExists(FNameFullPath))
{
FFileHelper::LoadANSITextFileToStrings(*FNameFullPath, NULL, *FileContent); // load on line per array element
return FileContent;
} else {
return nullptr;
};
}