DialogueScriptName

DialogueScriptName

#Overview

name: DialogueScriptName

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

#Summary

#Usage in the C++ source code

The purpose of DialogueScriptName is to specify the name of the dialogue script file used in the localization process for Unreal Engine games. This variable is primarily used in the context of importing and exporting dialogue scripts for different cultures and languages.

The Unreal Engine subsystems that rely on this setting variable are the Localization system and the UnrealEd module, specifically within the Import and Export Dialogue Script Commandlets. These commandlets are used for managing localized dialogue content in Unreal Engine projects.

The value of this variable is typically set in configuration files. It can be retrieved using the GetStringFromConfig function, as seen in the ImportDialogueScriptCommandlet and ExportDialogueScriptCommandlet code.

This variable interacts with other localization-related variables and settings, such as culture directories, source paths, and destination paths for localized content.

Developers must be aware that:

  1. The DialogueScriptName is crucial for identifying the correct file to import from or export to when working with localized dialogue content.
  2. It should be properly set in the configuration files before running the import or export commandlets.
  3. The same DialogueScriptName is used across different cultures, with the culture-specific path being determined separately.

Best practices when using this variable include:

  1. Use a consistent naming convention for dialogue script files across all cultures in your project.
  2. Ensure the DialogueScriptName is correctly set in all relevant configuration files.
  3. Verify that the specified DialogueScriptName exists in the expected locations before running import or export operations.
  4. Consider using the GetDefaultDialogueScriptFileName function to maintain consistency in naming across the project.
  5. When working with multiple cultures, ensure that the DialogueScriptName is appropriate and meaningful for all target languages.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Localization/EngineOverrides_ExportDialogueScript.ini:23, section: [CommonSettings]

Location: <Workspace>/Projects/Lyra/Config/Localization/EngineOverrides_ImportDialogueScript.ini:23, section: [CommonSettings]

Location: <Workspace>/Projects/Lyra/Config/Localization/Game_ExportDialogueScript.ini:23, section: [CommonSettings]

Location: <Workspace>/Projects/Lyra/Config/Localization/Game_ImportDialogueScript.ini:23, section: [CommonSettings]

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateImportDialogueScriptConfigFile

Source code excerpt:

				DialogueScriptFileName = GetDefaultDialogueScriptFileName(Target);
			}
			ConfigSection.Add(TEXT("DialogueScriptName"), DialogueScriptFileName);
			
			Script.AddCommonSettings(MoveTemp(ConfigSection));
		}

		// GatherTextStep0 - ImportDialogueScript
		{

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

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateExportDialogueScriptConfigFile

Source code excerpt:

				DialogueScriptFileName = GetDefaultDialogueScriptFileName(Target);
			}
			ConfigSection.Add(TEXT("DialogueScriptName"), DialogueScriptFileName);
			
			Script.AddCommonSettings(MoveTemp(ConfigSection));
		}

		// GatherTextStep0 - ExportDialogueScript
		{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ExportDialogueScriptCommandlet.cpp:146

Scope (from outer to inner):

file
function     int32 UExportDialogueScriptCommandlet::Main

Source code excerpt:


	// Get the dialogue script name
	FString DialogueScriptName;
	if (!GetStringFromConfig(*SectionName, TEXT("DialogueScriptName"), DialogueScriptName, ConfigPath))
	{
		UE_LOG(LogExportDialogueScriptCommandlet, Error, TEXT("No dialogue script name specified."));
		return -1;
	}

	// We may only have a single culture if using this setting

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ExportDialogueScriptCommandlet.cpp:310

Scope (from outer to inner):

file
function     int32 UExportDialogueScriptCommandlet::Main

Source code excerpt:

			}

			const FString CSVFileName = CultureDestinationPath / DialogueScriptName;
			const bool bCSVFileSaved = FLocalizedAssetSCCUtil::SaveFileWithSCC(SourceControlInfo, CSVFileName, [&](const FString& InSaveFileName) -> bool
			{
				return FFileHelper::SaveStringToFile(CSVFileData, *InSaveFileName, FFileHelper::EEncodingOptions::ForceUTF8);
			});

			if (!bCSVFileSaved)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ImportDialogueScriptCommandlet.cpp:119

Scope (from outer to inner):

file
function     int32 UImportDialogueScriptCommandlet::Main

Source code excerpt:


	// Get the dialogue script name
	FString DialogueScriptName;
	if (!GetStringFromConfig(*SectionName, TEXT("DialogueScriptName"), DialogueScriptName, ConfigPath))
	{
		UE_LOG(LogImportDialogueScriptCommandlet, Error, TEXT("No dialogue script name specified."));
		return -1;
	}

	// We may only have a single culture if using this setting

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

Scope (from outer to inner):

file
function     int32 UImportDialogueScriptCommandlet::Main

Source code excerpt:

		const FString CultureSourcePath = SourcePath / (bUseCultureDirectory ? NativeCulture : TEXT(""));
		const FString CultureDestinationPath = DestinationPath / NativeCulture;
		ImportDialogueScriptForCulture(LocTextHelper, CultureSourcePath / DialogueScriptName, NativeCulture, true);
	}

	// Import any remaining cultures
	for (const FString& CultureName : CulturesToGenerate)
	{
		// Skip the native culture as we already processed it above

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ImportDialogueScriptCommandlet.cpp:163

Scope (from outer to inner):

file
function     int32 UImportDialogueScriptCommandlet::Main

Source code excerpt:

		const FString CultureSourcePath = SourcePath / (bUseCultureDirectory ? CultureName : TEXT(""));
		const FString CultureDestinationPath = DestinationPath / CultureName;
		ImportDialogueScriptForCulture(LocTextHelper, CultureSourcePath / DialogueScriptName, CultureName, false);
	}

	return 0;
}

bool UImportDialogueScriptCommandlet::ImportDialogueScriptForCulture(FLocTextHelper& InLocTextHelper, const FString& InDialogueScriptFileName, const FString& InCultureName, const bool bIsNativeCulture)