bExportLoc

bExportLoc

#Overview

name: bExportLoc

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bExportLoc is to control whether localization data should be exported in Unreal Engine 5’s localization system. This boolean variable is used to determine if the engine should perform a localization export operation.

The Unreal Engine subsystems that rely on this setting variable are primarily the Localization system and the Internationalization module. It is used in the Localization Configuration Script, User Generated Content Localization, and the Internationalization Export Commandlet.

The value of this variable is typically set in configuration files or through the Unreal Editor’s project settings. It can also be set programmatically in C++ code when generating export configuration files.

This variable interacts closely with other localization-related settings, such as bImportLoc (for importing localization data) and LocalizedTextCollapseMode (for controlling how localized text is collapsed during export).

Developers must be aware that this variable is crucial for controlling the localization export process. When set to true, it enables the export of localization data, which is essential for preparing a game or application for localization.

Best practices when using this variable include:

  1. Ensuring it is set to true when you need to export localization data for translation or review.
  2. Using it in conjunction with other localization settings to fine-tune the export process.
  3. Being consistent with its usage across different localization targets within a project.
  4. Verifying its value before running localization commandlets to ensure the desired operation (export or import) is performed.
  5. Documenting any custom scripts or tools that modify this variable to maintain clarity in the localization workflow.

#Setting Variables

#References In INI files

<Workspace>/Engine/Config/Localization/Category.ini:64, section: [GatherTextStep5]
<Workspace>/Engine/Config/Localization/Editor.ini:108, section: [GatherTextStep7]
<Workspace>/Engine/Config/Localization/EditorTutorials.ini:64, section: [GatherTextStep5]
<Workspace>/Engine/Config/Localization/Engine.ini:86, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/Keywords.ini:59, section: [GatherTextStep5]
<Workspace>/Engine/Config/Localization/PortableObjectExport.ini:2, section: [CommonSettings]
<Workspace>/Engine/Config/Localization/PropertyNames.ini:64, section: [GatherTextStep5]
<Workspace>/Engine/Config/Localization/ToolTips.ini:67, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/Android/OnlineSubsystemGooglePlay/Config/Localization/OnlineSubsystemGooglePlay.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/IOS/OnlineSubsystemIOS/Config/Localization/OnlineSubsystemIOS.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineFramework/Config/Localization/OnlineFramework.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystem/Config/Localization/OnlineSubsystem.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystemAmazon/Config/Localization/OnlineSubsystemAmazon.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Config/Localization/OnlineSubsystemFacebook.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystemOculus/Config/Localization/OnlineSubsystemOculus.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystemSteam/Config/Localization/OnlineSubsystemSteam.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Config/Localization/OnlineSubsystemUtils.ini:55, section: [GatherTextStep5]
<Workspace>/Engine/Plugins/Runtime/HTTPChunkInstaller/Config/Localization/HTTPChunkInstaller.ini:55, section: [GatherTextStep5]
<Workspace>/Projects/Lyra/Config/Localization/EngineOverrides_Export.ini:27, section: [GatherTextStep0]
<Workspace>/Projects/Lyra/Config/Localization/Game_Export.ini:27, section: [GatherTextStep0]

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateExportTextConfigFile

Source code excerpt:

			ConfigSection.Add( TEXT("CommandletClass"), TEXT("InternationalizationExport") );

			ConfigSection.Add(TEXT("bExportLoc"), TEXT("true"));

			// Export-specific settings.
			{
				UEnum* LocalizedTextCollapseModeEnum = FindObjectChecked<UEnum>(nullptr, TEXT("/Script/Localization.ELocalizedTextCollapseMode"));
				const FName CollapseModeName = LocalizedTextCollapseModeEnum->GetNameByValue((int64)Target->Settings.ExportSettings.CollapseMode);
				ConfigSection.Add(TEXT("LocalizedTextCollapseMode"), CollapseModeName.ToString());

#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/UserGeneratedContentLocalization.cpp:385

Scope (from outer to inner):

file
namespace    UserGeneratedContentLocalization
function     bool ExportLocalization

Source code excerpt:

				ConfigSection.Add(TEXT("CommandletClass"), TEXT("InternationalizationExport"));

				ConfigSection.Add(TEXT("bExportLoc"), TEXT("true"));

				ConfigSection.Add(TEXT("POFormat"), StaticEnum<EPortableObjectFormat>()->GetNameStringByValue((int64)ExportOptions.UGCLocDescriptor.PoFormat));

				ConfigSection.Add(TEXT("ShouldPersistCommentsOnExport"), TEXT("true"));

				GatherConfig.AddGatherTextStep(GatherStepIndex++, MoveTemp(ConfigSection));

#Loc: <Workspace>/Engine/Source/Editor/TranslationEditor/Private/InternationalizationExportSettings.h:45

Scope (from outer to inner):

file
class        class UInternationalizationExportSettings : public UObject

Source code excerpt:

	/** Whether or not to export localization data */
	UPROPERTY(Category = GatherTextStep, EditAnywhere, config)
	bool bExportLoc;

	/** Whether or not to import localization data */
	UPROPERTY(Category = GatherTextStep, EditAnywhere, config)
	bool bImportLoc;

	/** Whether or not to use culture path */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/InternationalizationExportCommandlet.cpp:149

Scope (from outer to inner):

file
function     int32 UInternationalizationExportCommandlet::Main

Source code excerpt:


	bool bDoExport = false;
	GetBoolFromConfig(*SectionName, TEXT("bExportLoc"), bDoExport, ConfigPath);

	if (!bDoImport && !bDoExport)
	{
		UE_LOG(LogInternationalizationExportCommandlet, Error, TEXT("Import/Export operation not detected.  Use bExportLoc or bImportLoc in config section."));
		return -1;
	}