ShouldUseLocalizedNumericInput

ShouldUseLocalizedNumericInput

#Overview

name: ShouldUseLocalizedNumericInput

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

#Summary

#Usage in the C++ source code

The purpose of ShouldUseLocalizedNumericInput is to control whether localized numeric input should be used in the Unreal Engine editor and runtime environments. This setting is part of the internationalization system, which helps in adapting the engine and its content to different languages and regions.

This setting variable is primarily used by the Internationalization subsystem of Unreal Engine. It is referenced in the InternationalizationSettings module, which is part of the editor, and also in the Core runtime module.

The value of this variable is set in the GEditorSettingsIni configuration file. It can be modified through the InternationalizationSettingsModel class, which provides methods to get and set the value (ShouldUseLocalizedNumericInput() and SetShouldUseLocalizedNumericInput()).

This variable interacts with other internationalization settings, such as ShouldUseLocalizedPropertyNames and ShouldUseLocalizedNodeAndPinNames. Together, these settings control various aspects of localization in the engine.

Developers should be aware that this setting affects how numeric input is parsed and displayed throughout the engine. When enabled, it uses the current locale’s decimal number formatting rules instead of culture-agnostic rules. This can impact areas such as property editors, Blueprint nodes, and any other place where numeric input is accepted.

Best practices when using this variable include:

  1. Consistently using it across the project to ensure a uniform user experience.
  2. Testing the application thoroughly with different locales when this setting is enabled to ensure correct numeric input handling.
  3. Considering the target audience and their preferences when deciding whether to enable or disable this setting.
  4. Being aware that changing this setting may require adjustments in custom code that deals with numeric input parsing or formatting.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorSettings.ini:6, section: [Internationalization]

Location: <Workspace>/Engine/Config/BaseGameUserSettings.ini:2, section: [Internationalization]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/InternationalizationSettings/Classes/InternationalizationSettingsModel.h:133

Scope (from outer to inner):

file
class        class UInternationalizationSettingsModel : public UObject

Source code excerpt:

	bool GetPreviewGameLanguage(FString& OutPreviewGameLanguage) const;
	void SetPreviewGameLanguage(const FString& InPreviewGameLanguage);
	bool ShouldUseLocalizedNumericInput() const;
	void SetShouldUseLocalizedNumericInput(const bool Value);
	bool ShouldUseLocalizedPropertyNames() const;
	void SetShouldUseLocalizedPropertyNames(const bool Value);
	bool ShouldUseLocalizedNodeAndPinNames() const;
	void SetShouldUseLocalizedNodeAndPinNames(const bool Value);

#Loc: <Workspace>/Engine/Source/Editor/InternationalizationSettings/Private/InternationalizationSettingsModel.cpp:33

Scope (from outer to inner):

file
function     void UInternationalizationSettingsModel::ResetToDefault

Source code excerpt:

	GConfig->SetString( TEXT("Internationalization"), TEXT("Culture"), *SavedCultureName, GEditorSettingsIni );

	GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldUseLocalizedNumericInput"), true, GEditorSettingsIni );
	GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldUseLocalizedPropertyNames"), true, GEditorSettingsIni );
	GConfig->SetBool( TEXT("Internationalization"), TEXT("ShouldUseLocalizedNodeAndPinNames"), true, GEditorSettingsIni );

	GConfig->Flush(false, GEditorSettingsIni);

	FTextLocalizationManager::Get().ConfigureGameLocalizationPreviewLanguage(FString());

#Loc: <Workspace>/Engine/Source/Editor/InternationalizationSettings/Private/InternationalizationSettingsModel.cpp:83

Scope (from outer to inner):

file
function     bool UInternationalizationSettingsModel::ShouldUseLocalizedNumericInput

Source code excerpt:

}

bool UInternationalizationSettingsModel::ShouldUseLocalizedNumericInput() const
{
	bool bShouldUseLocalizedNumericInput = false;
	GConfig->GetBool(TEXT("Internationalization"), TEXT("ShouldUseLocalizedNumericInput"), bShouldUseLocalizedNumericInput, GEditorSettingsIni);
	return bShouldUseLocalizedNumericInput;
}

void UInternationalizationSettingsModel::SetShouldUseLocalizedNumericInput(const bool Value)
{
	GConfig->SetBool(TEXT("Internationalization"), TEXT("ShouldUseLocalizedNumericInput"), Value, GEditorSettingsIni);
	GConfig->Flush(false, GEditorSettingsIni);
}

bool UInternationalizationSettingsModel::ShouldUseLocalizedPropertyNames() const
{
	bool bShouldUseLocalizedPropertyNames = false;

#Loc: <Workspace>/Engine/Source/Editor/InternationalizationSettings/Private/InternationalizationSettingsModelDetails.cpp:441

Scope (from outer to inner):

file
function     void FInternationalizationSettingsModelDetails::CustomizeDetails
lambda-function

Source code excerpt:

			.IsChecked_Lambda([=]()
			{
				return SettingsModel.IsValid() && SettingsModel->ShouldUseLocalizedNumericInput() ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
			})
			.ToolTipText(NumericInputSettingToolTip)
			.OnCheckStateChanged_Lambda([=](ECheckBoxState State)
			{
				if (SettingsModel.IsValid())
				{

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Math/BasicMathExpressionEvaluator.cpp:28

Scope (from outer to inner):

file
namespace    ExpressionParser
function     const FDecimalNumberFormattingRules& GetLocalizedNumberFormattingRules

Source code excerpt:

	{
		bool bShouldUseLocalizedNumericInput = false;
		GConfig->GetBool(TEXT("Internationalization"), TEXT("ShouldUseLocalizedNumericInput"), bShouldUseLocalizedNumericInput, GIsEditor ? GEditorSettingsIni : GGameUserSettingsIni);
		return bShouldUseLocalizedNumericInput 
			? FInternationalization::Get().GetCurrentLocale()->GetDecimalNumberFormattingRules() 
			: FastDecimalFormat::GetCultureAgnosticFormattingRules();
	}

	TOptional<FStringToken> ParseNumberWithFallback(const FTokenStream& InStream, const FDecimalNumberFormattingRules& InPrimaryFormattingRules, const FDecimalNumberFormattingRules& InFallbackFormattingRules, FStringToken* Accumulate, double* OutValue)