GatherText commandlet getting excess values

I’m trying to setup my project for localization and the GatherText commandlet is harvesting a lot of extra values from the editor that shouldn’t be localized. We just upgraded to version 4.7.6.

I’ve looked at this question, and syncing to the changelist in that thread did fix the animation related issues referenced there. I’m still getting a lot of PinFriendlyName and PropertyTooltip values pulled out, particularly from K2Node_BreakStruct and similar graph nodes. A few examples from the manifest file:

“Source”: { “Text”: “Size of the resource in Slate Units” }, “Keys”: [ { “Key”: “1CE761AC43E23EFB870532B8A5B154E9”, “Path”: “/Game/UI/Blueprints/Shell/Play/BP_LobbyPlayerSlot.BP_LobbyPlayerSlot:GetVoiceIcon.K2Node_BreakStruct_125.PropertyTooltip” },
“Source”: { “Text”: “Texture” }, “Keys”: [ { “Key”: “0377C5CB4E0A85C69E418C9AF92D078D”, “Path”: “/Game/UI/Blueprints/Shell/AvatarCreator/BP_EditHair.BP_EditHair:ChangeFacialHair.K2Node_BreakStruct_71.EdGraphPin_20680.PinFriendlyName” },

I’m even getting a few values from the K2Node namespace, which I can see appear in NSLOCTEXT macros in the editor code:

“Namespace”: “K2Node”,
“Children”: [
{
“Source”:
{
“Text”: “Event”
},
“Keys”: [
{
“Key”: “PinFriendlyDelegatetName”,
“Path”: “/Game/UI/Blueprints/Shell/AvatarCreator/BP_EditAppearance.BP_EditAppearance:EventGraph.K2Node_AddDelegate_339.EdGraphPin_49145.PinFriendlyName”
}
]
},

And a few other similar engine values.

The LocSettings.ini I’m using right now I think is pretty straightforward and similar to others I’ve seen posted online.

[CommonSettings]
SourcePath=Content\Localization\Game
DestinationPath=Content\Localization\Game
ManifestName=LocalizedText.manifest
ArchiveName=LocalizedText.archive
ResourceName=LocalizedText.locres
PortableObjectName=LocalizedText.po
CulturesToGenerate=en
CulturesToGenerate=es

;Get all FTexts from Source
[GatherTextStep0]
CommandletClass=GatherTextFromSource
IncludePaths=Source/Bounty
ExcludePaths=*/Config/Localization/*
SourceFileSearchFilters=*.h
SourceFileSearchFilters=*.cpp


;Get all FTexts from Assets
[GatherTextStep1]
CommandletClass=GatherTextFromAssets
IncludePaths=Content
PackageExtensions=*.umap
PackageExtensions=*.uasset

;Generate Manifest
[GatherTextStep2]
CommandletClass=GenerateGatherManifest
DestinationPath=Content\Localization\Game

;Generate Archives
[GatherTextStep3]
CommandletClass=GenerateGatherArchive
bPurgeOldEmptyEntries=true

;Import new translations from PO (portable object) files into existing archives.
[GatherTextStep4]
CommandletClass=InternationalizationExport
bImportLoc=true

;Export new source from existing archives into PO (portable object) files.
[GatherTextStep5]
CommandletClass=InternationalizationExport
bExportLoc=true

;Generate Localized Text Resource
[GatherTextStep6]
CommandletClass=GenerateTextLocalizationResource
ResourceName=LocalizedText.locres 

Any ideas what I could have done to cause these sorts of values to leak into the GatherText results, or a way to work around this?

You should add ManifestDependencies entries in to your CommonSettings, specifying the paths to the manifest files for Engine and Editor localization targets within UE4 (IE: Engine/Content/Localization/Engine/Engine.manifest). This should cause any text that is part of the Engine and Editor to be excluded from your manifest.

For instance, if your project’s root directory is next to Engine:

[CommonSettings]
ManifestDependencies=../Engine/Content/Localization/Engine/Engine.manifest
ManifestDependencies=../Engine/Content/Localization/Editor/Editor.manifest

This should remove the remaining entries. If not, please let me know so I can investigate or provide an existing solution.

UPDATE: The following changelists should alleviate remaining issues with editor-only data being processed for gathering text when it isn’t desired.

2621214 Editor-only data is now gathered for localization by opting-in through a new setting.

2621217 Updated engine localization configuration scripts to use the new setting to gather text from editor-only data.

2621233 Made PinFriendlyName and relevant methods defined only in editors that have WITH_EDITORONLY_DATA evaluating as true.

2621263 Added ShouldGatherFromEditorOnlyData setting to localization dashboard UI for gathering from assets and metadata.

These should be in for 4.9, if you would prefer to wait and have the changes vetted by the 4.9 release date.

Thanks for the quick response. This cleaned up some but not all of the extra values I’m getting. The biggest remaining offenders appear to be BreakStruct, MakeStruct, SetMembersInStruct, and SwitchEnum nodes. There may be a couple others as there’s still a bit much for me to parse through to be confident I’ve found everything.

For the struct nodes, it looks like the names of the member variables and their tooltips are still getting pulled in as values to be localized. The first two examples in my original post are still present, and both come from instances where we’re breaking apart a SlateBrush struct to work on the values in it. It looks like I’m still getting these variable names and tooltips from both engine types and our own structs.

We’re also getting the names of enum values when switching on enums. These may be only from switching on our own enum types; is there something I need to add to UENUM macros or similar in order to filter those out so they don’t show up?

I’m glad that’s cleaned up most of it. Unfortunately, the remaining few seem tied to blueprint data which we’re working on excluding more effectively.

Some of it may disappear with a change that’s in 4.8 that excludes blueprint pin names from being gathered (CL# 2449367 I believe). This approach will be superseded eventually, probably in 4.9, with a far more comprehensive system that will exclude typically “editor-only” or “developer-oriented” text unless expressly requested.

This is something I’m very interested in too. I’m setting up our loc pipeline now and the export is 90% blueprint comments. Quite unusable TBH.

I’ve updated my answer with a new set of changelists that should resolve these issues.

Thanks, I’ll try it out as soon as I can.

Unfortunately, adding additional ManifestDependencies didn’t solve all the problems. We still have a lot of .PropertyTooltip values pulled out, that don’t belong to the project, but are somehow related to the animations.

I.e. “Active Child index” is pulled out, although we additionally added the PropertyNames.Manifest as dependency, where this string seems to be included.

We’re using 4.10 btw - so this might be a regression!?

Any feedback on this one?