GameTargetsSettings
GameTargetsSettings
#Overview
name: GameTargetsSettings
The value of this variable can be defined or overridden in .ini config files. 4
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of GameTargetsSettings is to manage localization target settings for game-specific content in Unreal Engine 5. This variable is part of the localization system, which is responsible for handling multiple language support in games developed with Unreal Engine.
GameTargetsSettings is primarily used in the Localization module of Unreal Engine. This can be seen from the file paths in the callsites, which are located in the “Developer/Localization” directory.
The value of this variable is set in two main ways:
- It is populated in the PostInitProperties function, where it creates ULocalizationTarget objects based on the settings stored in GameTargetsSettings.
- It is updated in the PostEditChangeProperty function, where changes made to the GameTargetSet are reflected back into GameTargetsSettings.
GameTargetsSettings interacts closely with the GameTargetSet variable, which is likely an instance of ULocalizationTargetSet. The relationship appears to be bidirectional, with data flowing between these two variables to keep them in sync.
Developers should be aware that:
- This variable is used to store configuration data (indicated by the UPROPERTY(config) decorator).
- Changes to GameTargetSet will be reflected in GameTargetsSettings and vice versa.
- The variable is used in editor-only code sections (wrapped in #if WITH_EDITOR), suggesting it’s primarily used for development and may not be available in shipped games.
Best practices when using this variable include:
- Ensure that any modifications to game localization targets are properly reflected in both GameTargetsSettings and GameTargetSet.
- Be cautious when directly modifying GameTargetsSettings, as it may impact the editor’s localization functionality.
- When adding new localization targets, make sure to update both the configuration data (GameTargetsSettings) and the runtime objects (GameTargetSet).
- Use the provided functions (PostInitProperties and PostEditChangeProperty) to manage changes to this variable, rather than modifying it directly, to ensure proper synchronization with other parts of the localization system.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditor.ini:520, section: [/Script/Localization.LocalizationSettings]
- INI Section:
/Script/Localization.LocalizationSettings
- Raw value:
(Name="Game",Guid=AE0EA34A45461A25BA65A391026F19F8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=-1,SupportedCulturesStatistics=((CultureName="en")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEditor.ini:66, section: [/Script/Localization.LocalizationSettings]
- INI Section:
/Script/Localization.LocalizationSettings
- Raw value:
(Name="Game",Guid=AE0EA34A45461A25BA65A391026F19F8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=False,SearchDirectories=,ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini"))),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,FileExtensions=((Pattern="umap"),(Pattern="uasset")),ShouldGatherFromEditorOnlyData=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),NativeCultureIndex=-1,SupportedCulturesStatistics=((CultureName="en")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEditor.ini:67, section: [/Script/Localization.LocalizationSettings]
- INI Section:
/Script/Localization.LocalizationSettings
- Raw value:
(Name="Game",Guid=AE0EA34A45461A25BA65A391026F19F8,TargetDependencies=(33482D004789784C9DA695A682ACCA1B,AC8BFD2A41A2FB2893BB8EA0AF903E6D),AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((Path="Source"),(Path="Config"),(Path="Plugins"),(PathRoot=Engine,Path="Source/Runtime/InputCore")),ExcludePathWildcards=((Pattern="Config/NoRedist/*"),(Pattern="Source/LyraEditor/*"),(Pattern="Plugins/PlayInEditorWizard/*"),(Pattern="Plugins/LyraExtTool/*")),FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini")),ShouldGatherFromEditorOnlyData=False),GatherFromPackages=(IsEnabled=True,IncludePathWildcards=((Pattern="Content/*"),(PathRoot=Project,Pattern="Plugins/GameFeatures/*")),ExcludePathWildcards=((Pattern="Content/Developers/*"),(Pattern="Content/*Test*"),(Pattern="Content/L10N/*"),(Pattern="Content/Tools/*")),FileExtensions=((Pattern="umap"),(Pattern="uasset")),Collections=("Audit_InCook"),ExcludeClasses=,ShouldExcludeDerivedClasses=False,ShouldGatherFromEditorOnlyData=False,SkipGatherCache=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),ExportSettings=(CollapseMode=IdenticalTextIdAndSource,POFormat=Unreal,ShouldPersistCommentsOnExport=True,ShouldAddSourceLocationsAsComments=True),CompileSettings=(SkipSourceCheck=False,ValidateFormatPatterns=True,ValidateSafeWhitespace=False),ImportDialogueSettings=(RawAudioPath=(Path=""),ImportedDialogueFolder="ImportedDialogue",bImportNativeAsSource=False),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="ar"),(CultureName="fr"),(CultureName="zh-Hans"),(CultureName="de"),(CultureName="it"),(CultureName="ja"),(CultureName="ko"),(CultureName="pt-BR"),(CultureName="pl"),(CultureName="ru"),(CultureName="es-419"),(CultureName="es"),(CultureName="tr")))
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultEditor.ini:68, section: [/Script/Localization.LocalizationSettings]
- INI Section:
/Script/Localization.LocalizationSettings
- Raw value:
(Name="EngineOverrides",Guid=5C65B52E4F69C2CF62360A9D4F62BC6E,TargetDependencies=,AdditionalManifestDependencies=,RequiredModuleNames=,GatherFromTextFiles=(IsEnabled=True,SearchDirectories=((PathRoot=Engine,Path="Source/Runtime/RHI"),(PathRoot=Engine,Path="Source/Runtime/InputCore"),(PathRoot=Engine,Path="Source/Runtime/Online/BuildPatchServices/Private"),(PathRoot=Engine,Path="Source/Runtime/Core/Private/GenericPlatform")),ExcludePathWildcards=,FileExtensions=((Pattern="h"),(Pattern="cpp"),(Pattern="ini")),ShouldGatherFromEditorOnlyData=False),GatherFromPackages=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=((Pattern="Content/L10N/*")),FileExtensions=((Pattern="umap"),(Pattern="uasset")),Collections=,ExcludeClasses=,ShouldExcludeDerivedClasses=False,ShouldGatherFromEditorOnlyData=False,SkipGatherCache=False),GatherFromMetaData=(IsEnabled=False,IncludePathWildcards=,ExcludePathWildcards=,KeySpecifications=,ShouldGatherFromEditorOnlyData=False),ExportSettings=(CollapseMode=IdenticalTextIdAndSource,POFormat=Unreal,ShouldPersistCommentsOnExport=False,ShouldAddSourceLocationsAsComments=True),CompileSettings=(SkipSourceCheck=False,ValidateFormatPatterns=True,ValidateSafeWhitespace=False),ImportDialogueSettings=(RawAudioPath=(Path=""),ImportedDialogueFolder="ImportedDialogue",bImportNativeAsSource=False),NativeCultureIndex=0,SupportedCulturesStatistics=((CultureName="en"),(CultureName="ar"),(CultureName="zh-Hans"),(CultureName="fr"),(CultureName="de"),(CultureName="it"),(CultureName="ja"),(CultureName="ko"),(CultureName="pl"),(CultureName="tr"),(CultureName="ru"),(CultureName="es"),(CultureName="es-419"),(CultureName="pt-BR")))
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/LocalizationSettings.cpp:37
Scope (from outer to inner):
file
function void ULocalizationSettings::PostInitProperties
Source code excerpt:
{
GameTargetSet->TargetObjects.Empty(EngineTargetsSettings.Num());
for (const auto& TargetSettings : GameTargetsSettings)
{
ULocalizationTarget* const TargetObject = NewObject<ULocalizationTarget>(GameTargetSet);
TargetObject->Settings = TargetSettings;
TargetObject->UpdateStatusFromConflictReport();
TargetObject->UpdateWordCountsFromCSV();
GameTargetSet->TargetObjects.Add(TargetObject);
#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/LocalizationSettings.cpp:65
Scope (from outer to inner):
file
function void ULocalizationSettings::PostEditChangeProperty
Source code excerpt:
if (GameTargetSet)
{
GameTargetsSettings.Empty(GameTargetSet->TargetObjects.Num());
for (const auto& TargetObject : GameTargetSet->TargetObjects)
{
GameTargetsSettings.Add(TargetObject ? TargetObject->Settings : FLocalizationTargetSettings());
}
}
TryUpdateDefaultConfigFile();
}
#endif
#Loc: <Workspace>/Engine/Source/Developer/Localization/Public/LocalizationSettings.h:36
Scope (from outer to inner):
file
class class ULocalizationSettings : public UObject
Source code excerpt:
UPROPERTY(config)
TArray<FLocalizationTargetSettings> GameTargetsSettings;
public:
#if WITH_EDITOR
virtual void PostInitProperties() override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif