Gather Text Not Finding FText in C++ Files

Hi everyone,

I’m using 4.27.2 and I’m trying to localize the key names in the engine source file InputCoreTypes.cpp .

#define LOCTEXT_NAMESPACE "InputKeys"

||AddKey(FKeyDetails(EKeys::CapsLock, LOCTEXT(CapsLock, Caps Lock), LOCTEXT(CapsLockShort, Caps)));|
|---|---|
||AddKey(FKeyDetails(EKeys::Escape, LOCTEXT(Escape, Escape), LOCTEXT(EscapeShort, Esc)));|
||AddKey(FKeyDetails(EKeys::SpaceBar, LOCTEXT(SpaceBar, Space Bar), LOCTEXT(SpaceBarShort, Space)));|
||AddKey(FKeyDetails(EKeys::PageUp, LOCTEXT(PageUp, Page Up), LOCTEXT(PageUpShort, PgUp)));|
||AddKey(FKeyDetails(EKeys::PageDown, LOCTEXT(PageDown, Page Down), LOCTEXT(PageDownShort, PgDn)));|

As you can see, they are all in the “InputKeys” name space, and they are all using LOCTEXT.

So they should be gathered by the Localization Dashboard if I include the engine source folder and all the .cpp, .hpp, etc. files.

The trouble is, they are not found.

I tried to create my own namespace in a .cpp file located in the project source folder:

#define LOCTEXT_NAMESPACE "MyNameSpace"

FText MyFunctionLibrary::ReturnText()
{
	
	return NSLOCTEXT("MyNameSpace","TestingMe", "Testing Me");
}

#undef LOCTEXT_NAMESPACE

This is also not found by the Localization Dashboard…

Am I doing something wrong or is this a bug? :pensive:

Were you able to figure this out? I’m having the same issue.

Nevermind, I finally figured out my problem.

In the configuration for my game Target in the Localization Dashboard, I had a “engine” checked in Target Dependencies, thus it was excluding the InputCoreTypes.cpp I was trying to include as duplicates.