WordCountReportName

WordCountReportName

#Overview

name: WordCountReportName

The value of this variable can be defined or overridden in .ini config files. 18 .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 WordCountReportName is to specify the filename for the word count report generated during the localization process in Unreal Engine 5.

This setting variable is primarily used by the Localization subsystem and the UnrealEd module, specifically in the context of generating localization reports and configuration files.

The value of this variable is typically set in localization configuration files. It’s retrieved using the GetStringFromConfig function, which reads the value from the specified configuration file.

WordCountReportName interacts with other localization-related variables and functions, such as:

Developers should be aware that:

  1. This variable is crucial for proper naming and identification of word count reports in the localization pipeline.
  2. The value should be a valid filename that adheres to the target platform’s file naming conventions.
  3. It’s used in both configuration generation and report generation processes.

Best practices when using this variable include:

  1. Use descriptive and consistent naming conventions for the report files.
  2. Ensure the specified filename is unique to avoid overwriting existing reports.
  3. Consider including relevant metadata in the filename, such as project name, language, or date.
  4. Verify that the localization configuration correctly sets this variable before running localization processes.
  5. Use the GetWordCountCSVFileName function when possible to maintain consistency in filename generation.

By following these practices, developers can ensure proper organization and management of localization word count reports within their Unreal Engine 5 projects.

#Setting Variables

#References In INI files

<Workspace>/Engine/Config/Localization/Category.ini:71, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/Editor.ini:115, section: [GatherTextStep8]
<Workspace>/Engine/Config/Localization/EditorTutorials.ini:71, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/Engine.ini:93, section: [GatherTextStep7]
<Workspace>/Engine/Config/Localization/Keywords.ini:66, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/PropertyNames.ini:71, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/ToolTips.ini:74, section: [GatherTextStep6]
<Workspace>/Engine/Config/Localization/WordCount.ini:23, section: [GatherTextStep0]
<Workspace>/Engine/Config/Localization/WordCount.ini:30, section: [GatherTextStep1]
<Workspace>/Engine/Config/Localization/WordCount.ini:37, section: [GatherTextStep2]
<Workspace>/Engine/Config/Localization/WordCount.ini:44, section: [GatherTextStep3]
<Workspace>/Engine/Config/Localization/WordCount.ini:51, section: [GatherTextStep4]
<Workspace>/Engine/Config/Localization/WordCount.ini:58, section: [GatherTextStep5]
<Workspace>/Engine/Config/Localization/WordCount.ini:65, section: [GatherTextStep6]
<Workspace>/Projects/Lyra/Config/Localization/EngineOverrides_Gather.ini:45, section: [GatherTextStep3]
<Workspace>/Projects/Lyra/Config/Localization/EngineOverrides_GenerateReports.ini:26, section: [GatherTextStep0]
<Workspace>/Projects/Lyra/Config/Localization/Game_Gather.ini:67, section: [GatherTextStep4]
<Workspace>/Projects/Lyra/Config/Localization/Game_GenerateReports.ini:26, 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:486

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateGatherTextConfigFile

Source code excerpt:


			ConfigSection.Add( TEXT("bWordCountReport"), TEXT("true") );
			ConfigSection.Add( TEXT("WordCountReportName"), GetWordCountCSVFileName(Target) );

			ConfigSection.Add( TEXT("bConflictReport"), TEXT("true") );
			ConfigSection.Add( TEXT("ConflictReportName"), GetConflictReportFileName(Target) );

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

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

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateWordCountReportConfigFile

Source code excerpt:

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

			ConfigSection.Add( TEXT("WordCountReportName"), GetWordCountCSVFileName(Target) );

			Script.AddGatherTextStep(0, MoveTemp(ConfigSection));
		}

		Script.Dirty = true;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GenerateTextLocalizationReportCommandlet.cpp:137

Scope (from outer to inner):

file
function     bool UGenerateTextLocalizationReportCommandlet::ProcessWordCountReport

Source code excerpt:


	// Get report name.
	FString WordCountReportName;
	if( !( GetStringFromConfig( *SectionName, TEXT("WordCountReportName"), WordCountReportName, GatherTextConfigPath ) ) )
	{
		UE_LOG(LogGenerateTextLocalizationReportCommandlet, Error, TEXT("No word count report name specified."));
		return false;
	}

	// Get cultures to generate.

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GenerateTextLocalizationReportCommandlet.cpp:168

Scope (from outer to inner):

file
function     bool UGenerateTextLocalizationReportCommandlet::ProcessWordCountReport

Source code excerpt:

	}

	const FString ReportFilePath = (DestinationPath / WordCountReportName);

	FText ReportSaveError;
	if (!LocTextHelper.SaveWordCountReport(Timestamp, ReportFilePath, &ReportSaveError))
	{
		UE_LOG(LogGenerateTextLocalizationReportCommandlet, Error, TEXT("%s"), *ReportSaveError.ToString());
		return false;