It seems that with the new method of storing the localization data in assets as per the GatherLocalizationDataFromPropertiesOfDataStructure, that the localization process now adds in a lot of editor things like tooltips from assets even with the ShouldGatherFromEditorOnlyData=false
For example the PropertyTooltip in the FOptionalPinFromProperty struct (ShowPinForProperties.PropertyTooltip), which isn’t an editor only property. This seems to be a big culprit for us, but we are also seeing two other properties:
This is taken up a large chunk of our localization files.
I plan to add some code to hack out these property names since in our case we wont have duplication here, however if there a reason these properties couldn’t be marked as editor only? (with WITH_EDITORONLY_DATA )
Is there a more officially approved way I could implement this?
We’ve seen this ourselves internally, and have fixed it in two ways (one sticky plaster, and one robust).
The sticky plaster solution is the one you suggested (wrapping the properties in WITH_EDITORONLY_DATA). These fixes should be present as of 4.10.1.
The more robust solution is to gather the game text from the blueprint bytecode, and mark everything else that’s part of the blueprint asset as editor-only. This change should be present as of 4.11.
I’ve seen a lot of those annoying ShowPinForProperties.PropertyTooltip myself, so I’ve tested/debugged a small example, and I noticed they clean up when I “force load” the assets during the gathering (MustLoadForGather stuff in UGatherTextFromAssetsCommandlet::Main)
Alternatively, re-saving a particular asset also seems to work, so to summarize:
No force load, asset left as-is (kind of old, I guess) => bad
Force load => good
No force load but asset re-saved => bad
I must admit the MustLoadForGather rules (VER_UE4_PACKAGE_REQUIRES_LOCALIZATION_GATHER_FLAGGING stuff…) look a bit complicated - are there known bugs? Do I have another option than… re-saving all assets??
I should have mentioned before, but you’d need to re-save the assets to update the cache of texts they store in their header after getting these fixes.
There have actually been some more fixes made since (as we can’t correctly cache texts from things that contain bytecode, so those always get loaded), plus we added a version bump so that this manual re-saving to get a clean gather isn’t needed (any older assets are just fully loaded to make sure they’re up-to-date).
There’s nothing wrong with changing that code to just load any assets that contain texts (PackageFileSummary.GetFileVersionUE4() < VER_UE4_PACKAGE_REQUIRES_LOCALIZATION_GATHER_FLAGGING || PackageFileSummary.PackageFlags & PKG_RequiresLocalizationGather), but it will make your gather a lot slower.