Hello, I’m having trouble importing .csv files as string tables in C++.
I’ve followed the instructions from this tutorial by Benui but the tables still aren’t visible inside the editor, and I just get <Missing string table entry>
when I try to reference a table in C++.
This is what my C++ looks like inside my MyProject.cpp file:
#include "MyProject.h"
#include "Internationalization/StringTableRegistry.h"
#include "Modules/ModuleManager.h"
void FMyProject::StartupModule()
{
FDefaultGameModuleImpl::StartupModule();
LOCTABLE_FROMFILE_GAME("WebBrowserOverlayStrings","WebBrowserOverlayStrings","NonAssets/WebBrowserOverlay.csv");
LOCTABLE_FROMFILE_GAME("TooltipStrings","TooltipStrings","NonAssets/Tooltips.csv");
LOCTABLE_FROMFILE_GAME("LoginStrings","LoginStrings","NonAssets/Login.csv");
// Trying to create a new one didn't work either
LOCTABLE_NEW("CodeStringTable","CodeStringTable");
LOCTABLE_SETSTRING("CodeStringTable","HelloWorld","Hello World!");
LOCTABLE_SETMETA("CodeStringTable","HelloWorld","Comment","This is a comment about hello world");
LOCTABLE_SETSTRING("CodeStringTable","GoodbyeWorld","Goodbye World!");
LOCTABLE_SETMETA("CodeStringTable","GoodbyeWorld","Comment","This is a comment about goodbye world");
}
void FMyProject::ShutdownModule()
{
FDefaultGameModuleImpl::ShutdownModule();
}
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, MyProject, "MyProject" );
I’ve included the directory (NonAssets) in the “Additional NonAssets to include”, which is at the root of my Content folder.
The format of my CSV files are like so:
Key,SourceString
"SomeKeyText","Text that corresponds to the key."
Would greatly appreciate some help!
Thanks,
Mark