SkipGatherCache

SkipGatherCache

#Overview

name: SkipGatherCache

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of SkipGatherCache is to control the text gathering process in Unreal Engine’s localization system. It is used to determine whether the system should ignore the cached text in package headers and perform a full package load instead during the localization process.

This setting variable is primarily used in the Localization subsystem of Unreal Engine. It is referenced in the Localization module and the UnrealEd module, specifically in the GatherTextFromAssetsCommandlet.

The value of this variable is typically set in configuration files or through the Unreal Editor’s localization settings. It can be found in the FGatherTextFromPackagesConfiguration struct, which is part of the localization target settings.

SkipGatherCache interacts with other localization-related variables, such as ShouldGatherFromEditorOnlyData and ReportStaleGatherCache. These variables work together to control various aspects of the text gathering process for localization.

Developers must be aware that setting SkipGatherCache to true may significantly increase the time required for the text gathering process, as it forces a full package load instead of using cached data. This can be particularly impactful for large projects with many assets.

Best practices when using this variable include:

  1. Only enable it when necessary, such as when debugging localization issues or when you suspect the cache might be outdated.
  2. Consider using it in conjunction with other cache-related settings like ReportStaleGatherCache and FixStaleGatherCache to manage the localization cache effectively.
  3. Be prepared for longer processing times when this option is enabled, especially for large projects.
  4. Use it sparingly in production environments, as it can negatively impact performance during the localization process.
  5. When enabled, ensure that all necessary assets are loaded and available to avoid missing any localizable text.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Localization/Game_Gather.ini:56, section: [GatherTextStep1]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/LocalizationConfigurationScript.cpp:400

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateGatherTextConfigFile

Source code excerpt:


			ConfigSection.Add( TEXT("ShouldGatherFromEditorOnlyData"), Target->Settings.GatherFromPackages.ShouldGatherFromEditorOnlyData ? TEXT("true") : TEXT("false") );
			ConfigSection.Add( TEXT("SkipGatherCache"), Target->Settings.GatherFromPackages.SkipGatherCache ? TEXT("true") : TEXT("false") );

			Script.AddGatherTextStep(GatherTextStepIndex++, MoveTemp(ConfigSection));
		}

		// GatherTextFromMetadata
		if (Target->Settings.GatherFromMetaData.IsEnabled)

#Loc: <Workspace>/Engine/Source/Developer/Localization/Public/LocalizationTargetTypes.h:159

Scope (from outer to inner):

file
function     FGatherTextFromPackagesConfiguration

Source code excerpt:

		, ShouldExcludeDerivedClasses(false)
		, ShouldGatherFromEditorOnlyData(false)
		, SkipGatherCache(false)
	{
		{
			FGatherTextExcludePath L10NPath;
			L10NPath.Pattern = TEXT("Content/L10N/*");
			ExcludePathWildcards.Add(L10NPath);
		}

#Loc: <Workspace>/Engine/Source/Developer/Localization/Public/LocalizationTargetTypes.h:202

Scope: file

Source code excerpt:

	/* Should we ignore the cached text in the package header and perform a full package load instead? */
	UPROPERTY(config, EditAnywhere, Category = "Gather Text", AdvancedDisplay)
	bool SkipGatherCache;

	LOCALIZATION_API bool Validate(const bool bIsEngineTarget, FText& OutError) const;
};

USTRUCT()
struct FMetaDataTextKeyPattern

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GatherTextFromAssetsCommandlet.cpp:1563

Scope (from outer to inner):

file
function     bool UGatherTextFromAssetsCommandlet::ConfigureFromScript

Source code excerpt:

	};

	ReadBoolFlagWithFallback(TEXT("SkipGatherCache"), bSkipGatherCache);
	ReadBoolFlagWithFallback(TEXT("ReportStaleGatherCache"), bReportStaleGatherCache);
	ReadBoolFlagWithFallback(TEXT("FixStaleGatherCache"), bFixStaleGatherCache);
	ReadBoolFlagWithFallback(TEXT("FixMissingGatherCache"), bFixMissingGatherCache);

	// Read some settings from the editor config
	{