ShouldExcludeDerivedClasses

ShouldExcludeDerivedClasses

#Overview

name: ShouldExcludeDerivedClasses

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShouldExcludeDerivedClasses is to control the behavior of text gathering from packages in Unreal Engine’s localization system. Specifically, it determines whether classes derived from those in the exclude classes list should also be excluded from the gathering process.

This setting variable is primarily used within the Localization module of Unreal Engine. Based on the callsites, it is utilized in the process of generating localization configuration files and is part of the FGatherTextFromPackagesConfiguration structure.

The value of this variable is set in the FGatherTextFromPackagesConfiguration structure, which is likely initialized when setting up localization targets. It is defined as a boolean property that can be configured and edited in the Unreal Editor.

ShouldExcludeDerivedClasses interacts with other localization-related variables, such as IsEnabled, FileExtensions, ShouldGatherFromEditorOnlyData, and SkipGatherCache, which are all part of the same configuration structure.

Developers must be aware that enabling this option will exclude not only the specified classes from text gathering but also any classes that inherit from them. This can have a significant impact on the scope of text gathered for localization.

Best practices when using this variable include:

  1. Carefully consider which classes need to be excluded and whether their derived classes should also be excluded.
  2. Document the rationale behind excluding certain classes and their derivatives to maintain clarity in the localization process.
  3. Regularly review the excluded classes to ensure the setting remains appropriate as the project evolves.
  4. Test the localization process thoroughly after changing this setting to ensure all necessary text is still being gathered.
  5. Use this option in conjunction with other filtering mechanisms to achieve precise control over the text gathering process.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Localization/Game_Gather.ini:54, 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:397

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateGatherTextConfigFile

Source code excerpt:

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

			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));
		}

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

Scope (from outer to inner):

file
function     FGatherTextFromPackagesConfiguration

Source code excerpt:

		: IsEnabled(true)
		, FileExtensions(GetDefaultPackageFileExtensions())
		, ShouldExcludeDerivedClasses(false)
		, ShouldGatherFromEditorOnlyData(false)
		, SkipGatherCache(false)
	{
		{
			FGatherTextExcludePath L10NPath;
			L10NPath.Pattern = TEXT("Content/L10N/*");

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

Scope: file

Source code excerpt:

	/* Should classes derived from those in the exclude classes list also be excluded from gathering? */
	UPROPERTY(config, EditAnywhere, Category = "Filter")
	bool ShouldExcludeDerivedClasses;

	/* If enabled, data that is specified as editor-only may be processed for gathering. */
	UPROPERTY(config, EditAnywhere, Category = "Gather Text")
	bool ShouldGatherFromEditorOnlyData;

	/* Should we ignore the cached text in the package header and perform a full package load instead? */