Localization.SpanishUsesRAENumberFormat

Localization.SpanishUsesRAENumberFormat

#Overview

name: Localization.SpanishUsesRAENumberFormat

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Localization.SpanishUsesRAENumberFormat is to control the number formatting style for Spanish localization in Unreal Engine 5. It determines whether to use the RAE (Real Academia EspaƱola) format or the CLDR (Common Locale Data Repository) format for number representation in Spanish.

This setting variable is primarily used in the Internationalization subsystem of Unreal Engine 5, specifically within the ICUCulture module. It affects how numbers are formatted and displayed in Spanish localized content.

The value of this variable is set using a console variable (CVar) system. It is defined as a TAutoConsoleVariable with a default value of true, meaning the RAE format is enabled by default.

The associated variable CVarSpanishUsesRAENumberFormat directly interacts with Localization.SpanishUsesRAENumberFormat. They share the same value and purpose.

Developers must be aware that:

  1. This variable affects Spanish number formatting throughout the engine.
  2. Changing this setting will impact all Spanish localized content that involves number representation.
  3. The RAE format uses a space as the group separator and a comma as the decimal separator, while the CLDR format uses a dot for grouping.

Best practices when using this variable include:

  1. Consistency: Decide on a format (RAE or CLDR) and stick to it throughout the project.
  2. Documentation: Clearly document which format is being used in the project for all team members.
  3. Testing: Thoroughly test number formatting in Spanish localized content after changing this setting.
  4. Localization experts: Consult with Spanish localization experts to determine the most appropriate format for the target audience.

Regarding the associated variable CVarSpanishUsesRAENumberFormat:

The purpose of CVarSpanishUsesRAENumberFormat is to provide programmatic access to the Localization.SpanishUsesRAENumberFormat setting within the C++ code.

This variable is used in the Core module of Unreal Engine, specifically in the Internationalization system.

The value of CVarSpanishUsesRAENumberFormat is set when the engine initializes the console variable system. It mirrors the value of Localization.SpanishUsesRAENumberFormat.

CVarSpanishUsesRAENumberFormat directly interacts with the ICU (International Components for Unicode) library to determine the number formatting rules for Spanish.

Developers should be aware that:

  1. This variable is used in the internals of the engine’s localization system.
  2. Changes to this variable will affect the behavior of Spanish number formatting at runtime.

Best practices for using CVarSpanishUsesRAENumberFormat include:

  1. Use the GetBool() method to check its value when determining number formatting rules.
  2. Avoid directly modifying this variable; instead, use the console command system to change Localization.SpanishUsesRAENumberFormat.
  3. Consider the implications on existing localized content when changing this setting during development.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Internationalization/ICUCulture.cpp:18

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarSpanishUsesRAENumberFormat(
	TEXT("Localization.SpanishUsesRAENumberFormat"),
	true,
	TEXT("False: Disabled (CLDR format), True: Enabled (RAE format, default)."),
	ECVF_Default
	);

static TAutoConsoleVariable<bool> CVarSpanishUsesMinTwoGrouping(

#Associated Variable and Callsites

This variable is associated with another variable named CVarSpanishUsesRAENumberFormat. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Internationalization/ICUCulture.cpp:17

Scope: file

Source code excerpt:

	);

static TAutoConsoleVariable<bool> CVarSpanishUsesRAENumberFormat(
	TEXT("Localization.SpanishUsesRAENumberFormat"),
	true,
	TEXT("False: Disabled (CLDR format), True: Enabled (RAE format, default)."),
	ECVF_Default
	);

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Internationalization/ICUCulture.cpp:730

Scope (from outer to inner):

file
namespace    anonymous
function     FDecimalNumberFormattingRules ExtractNumberFormattingRulesFromICUDecimalFormatter

Source code excerpt:

	{
		// The CLDR uses a dot as the group separator for Spanish, however the RAE favor using a space: https://www.rae.es/dpd/n%C3%BAmeros
		if (CVarSpanishUsesRAENumberFormat.AsVariable()->GetBool())
		{
			NewUEDecimalNumberFormattingRules.GroupingSeparatorCharacter = TEXT('\u00A0'); // No-Break Space
			NewUEDecimalNumberFormattingRules.DecimalSeparatorCharacter = TEXT(',');
		}

		// Should we use "min two" grouping for Spanish (eg, "1234" formats as "1234" rather than "1 234", but "12345" still formats as "12 345")