bSkipSourceCheck

bSkipSourceCheck

#Overview

name: bSkipSourceCheck

The value of this variable can be defined or overridden in .ini config files. 2 .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 bSkipSourceCheck is to control whether the source text check should be skipped during localization processes in Unreal Engine 5. This variable is primarily used in the localization system to determine how to handle translations when compiling or generating localization resources.

This setting variable is mainly relied upon by the Localization module in Unreal Engine 5. It’s used in the FLocTextHelper class, which is part of the core localization functionality, and in the GenerateTextLocalizationResourceCommandlet, which is used for generating localization resources.

The value of this variable is typically set in configuration files. As seen in the LocalizationConfigurationScript.cpp file, it’s added to the configuration section based on the Target->Settings.CompileSettings.SkipSourceCheck value.

bSkipSourceCheck interacts with other localization-related variables and settings, such as bValidateFormatPatterns and bValidateSafeWhitespace, which are often configured alongside it.

Developers must be aware that when bSkipSourceCheck is set to true, it allows the use of potentially stale translations. This means that translations might be used even if they don’t match the current source text, which could lead to outdated or incorrect translations in the game.

Best practices when using this variable include:

  1. Only enable it when you’re confident that your translations are up-to-date and you want to skip the source check for performance reasons.
  2. Use it cautiously in production builds, as it may lead to inconsistencies between the source text and translations.
  3. Combine its use with thorough testing of localized content to ensure accuracy.
  4. Consider using it temporarily during development or rapid iteration phases, but verify translations before final release.
  5. Document clearly when and why this option is enabled in your project to maintain clarity for all team members working on localization.

#Setting Variables

#References In INI files

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

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/Localization/Private/LocTextHelper.cpp:1160

Scope (from outer to inner):

file
function     void FLocTextHelper::GetRuntimeText

Source code excerpt:

}

void FLocTextHelper::GetRuntimeText(const FString& InCulture, const FLocKey& InNamespace, const FLocKey& InKey, const TSharedPtr<FLocMetadataObject> InKeyMetadataObj, const ELocTextExportSourceMethod InSourceMethod, const FLocItem& InSource, FLocItem& OutTranslation, const bool bSkipSourceCheck) const
{
	OutTranslation = InSource;

	TSharedPtr<FArchiveEntry> ArchiveEntry = FindTranslationImpl(InCulture, InNamespace, InKey, InKeyMetadataObj);
	if (ArchiveEntry.IsValid() && !ArchiveEntry->Translation.Text.IsEmpty())
	{
		if (bSkipSourceCheck)
		{
			// Set the export text to use the current translation
			OutTranslation = ArchiveEntry->Translation;
		}
		else
		{

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

Scope (from outer to inner):

file
namespace    LocalizationConfigurationScript
function     FLocalizationConfigurationScript GenerateCompileTextConfigFile

Source code excerpt:

			ConfigSection.Add( TEXT("ResourceName"), GetLocResFileName(Target) );

			ConfigSection.Add( TEXT("bSkipSourceCheck"), Target->Settings.CompileSettings.SkipSourceCheck ? TEXT("true") : TEXT("false") );
			ConfigSection.Add( TEXT("bValidateFormatPatterns"), Target->Settings.CompileSettings.ValidateFormatPatterns ? TEXT("true") : TEXT("false") );
			ConfigSection.Add( TEXT("bValidateSafeWhitespace"), Target->Settings.CompileSettings.ValidateSafeWhitespace ? TEXT("true") : TEXT("false") );

			if (Target->Settings.SupportedCulturesStatistics.IsValidIndex(Target->Settings.NativeCultureIndex))
			{
				ConfigSection.Add( TEXT("NativeCulture"), Target->Settings.SupportedCulturesStatistics[Target->Settings.NativeCultureIndex].CultureName );

#Loc: <Workspace>/Engine/Source/Developer/Localization/Public/LocTextHelper.h:802

Scope (from outer to inner):

file
function     class LOCALIZATION_API FLocTextHelper { public: /** * Construct an empty helper. * @note This kind of helper is only suitable for dealing with manifests, *not* archives. * * @param InLocFileN

Source code excerpt:

	 * @param InSource				The raw source text to use as a fallback.
	 * @param OutTranslation		The translation to use.
	 * @param bSkipSourceCheck		True to skip the source check and just return any matching translation.
	 */
	void GetRuntimeText(const FString& InCulture, const FLocKey& InNamespace, const FLocKey& InKey, const TSharedPtr<FLocMetadataObject> InKeyMetadataObj, const ELocTextExportSourceMethod InSourceMethod, const FLocItem& InSource, FLocItem& OutTranslation, const bool bSkipSourceCheck) const;

	/**
	 * Add a new conflict entry.
	 *
	 * @param InNamespace			The namespace of the entry.
	 * @param InKey					The key/identifier of the entry.
	 * @param InKeyMetadata			Entry Metadata keys.
	 * @param InSource				The source info for the conflict.
	 * @param InSourceLocation		The source location of the conflict.
	 */
	void AddConflict(const FLocKey& InNamespace, const FLocKey& InKey, const TSharedPtr<FLocMetadataObject>& InKeyMetadata, const FLocItem& InSource, const FString& InSourceLocation);

	/**
	 * Get a conflict report that can be easily saved as a report summary.
	 */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GenerateTextLocalizationResourceCommandlet.cpp:134

Scope (from outer to inner):

file
function     int32 UGenerateTextLocalizationResourceCommandlet::Main

Source code excerpt:

	// Get whether to skip the source check.
	{
		bool bSkipSourceCheck = false;
		GetBoolFromConfig(*SectionName, TEXT("bSkipSourceCheck"), bSkipSourceCheck, GatherTextConfigPath);
		GenerateFlags |= (bSkipSourceCheck ? EGenerateLocResFlags::AllowStaleTranslations : EGenerateLocResFlags::None);
	}

	// Get whether to validate format patterns.
	{
		bool bValidateFormatPatterns = false;
		GetBoolFromConfig(*SectionName, TEXT("bValidateFormatPatterns"), bValidateFormatPatterns, GatherTextConfigPath);