UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTextLocalizationManager Class Reference

#include <TextLocalizationManager.h>

Public Member Functions

CORE_API ~FTextLocalizationManager ()
 
 UE_NONCOPYABLE (FTextLocalizationManager)
 
CORE_API void DumpMemoryInfo () const
 
CORE_API void CompactDataStructures ()
 
CORE_API FString GetRequestedLanguageName () const
 
CORE_API FString GetRequestedLocaleName () const
 
CORE_API FString GetNativeCultureName (const ELocalizedTextSourceCategory InCategory) const
 
CORE_API TArray< FString > GetLocalizedCultureNames (const ELocalizationLoadFlags InLoadFlags) const
 
CORE_API int32 GetLocalizationTargetPathId (FStringView InLocalizationTargetPath)
 
CORE_API void RegisterTextSource (const TSharedRef< ILocalizedTextSource > &InLocalizedTextSource, const bool InRefreshResources=true)
 
CORE_API void RegisterPolyglotTextData (const FPolyglotTextData &InPolyglotTextData, const bool InAddDisplayString=true)
 
CORE_API void RegisterPolyglotTextData (TArrayView< const FPolyglotTextData > InPolyglotTextDataArray, const bool InAddDisplayStrings=true)
 
CORE_API FTextConstDisplayStringPtr FindDisplayString (const FTextKey &Namespace, const FTextKey &Key, const FString *const SourceStringPtr=nullptr) const
 
CORE_API FTextConstDisplayStringPtr GetDisplayString (const FTextKey &Namespace, const FTextKey &Key, const FString *const SourceStringPtr) const
 
CORE_API void UpdateFromLocalizationResource (const FString &LocalizationResourceFilePath)
 
CORE_API void UpdateFromLocalizationResource (const FTextLocalizationResource &TextLocalizationResource)
 
CORE_API void WaitForAsyncTasks ()
 
CORE_API void NotifyWhenAsyncTasksCompleted (TUniqueFunction< void()> &&Notification)
 
CORE_API void RefreshResources (TUniqueFunction< void()> &&Notification=nullptr)
 
CORE_API void HandleLocalizationTargetsMounted (TArrayView< const FString > LocalizationTargetPaths, TUniqueFunction< void()> &&Notification=nullptr)
 
CORE_API void HandleLocalizationTargetsUnmounted (TArrayView< const FString > LocalizationTargetPaths, TUniqueFunction< void()> &&Notification=nullptr)
 
CORE_API uint16 GetTextRevision () const
 
CORE_API uint16 GetLocalRevisionForTextId (const FTextId &InTextId) const
 
CORE_API void GetTextRevisions (const FTextId &InTextId, uint16 &OutGlobalTextRevision, uint16 &OutLocalTextRevision) const
 
CORE_API bool ShouldForceLoadGameLocalization () const
 

Static Public Member Functions

static CORE_API FTextLocalizationManagerGet ()
 
static CORE_API void TearDown ()
 
static CORE_API bool IsDisplayStringSupportEnabled ()
 

Public Attributes

FTextRevisionChangedEvent OnTextRevisionChangedEvent
 

Friends

class FLazySingleton
 
CORE_API void BeginPreInitTextLocalization ()
 
CORE_API void BeginInitTextLocalization ()
 
CORE_API void InitEngineTextLocalization ()
 
CORE_API void InitGameTextLocalization ()
 

Detailed Description

Singleton class that manages display strings for FText.

Constructor & Destructor Documentation

◆ ~FTextLocalizationManager()

FTextLocalizationManager::~FTextLocalizationManager ( )

Member Function Documentation

◆ CompactDataStructures()

void FTextLocalizationManager::CompactDataStructures ( )

◆ DumpMemoryInfo()

void FTextLocalizationManager::DumpMemoryInfo ( ) const

◆ FindDisplayString()

FTextConstDisplayStringPtr FTextLocalizationManager::FindDisplayString ( const FTextKey Namespace,
const FTextKey Key,
const FString *const  SourceStringPtr = nullptr 
) const

Finds and returns the display string with the given namespace and key, if it exists.

Note
If a non-null and non-empty source string is specified and the found localized display string was not localized from that source string, null will be returned.

◆ Get()

FTextLocalizationManager & FTextLocalizationManager::Get ( )
static

Singleton accessor

◆ GetDisplayString()

FTextConstDisplayStringPtr FTextLocalizationManager::GetDisplayString ( const FTextKey Namespace,
const FTextKey Key,
const FString *const  SourceStringPtr 
) const

Get the current display string for the given namespace and key, if any.

Note
If a non-null and non-empty source string is specified and the found localized display string was not localized from that source string, it will be considered unlocalized.

Unlike FindDisplayString:

  • This function may adjust the given text ID (eg, when USE_STABLE_LOCALIZATION_KEYS is enabled).
  • This function may return a value for unlocalized strings (eg, when using -LEETifyUnlocalized).

◆ GetLocalizationTargetPathId()

int32 FTextLocalizationManager::GetLocalizationTargetPathId ( FStringView  InLocalizationTargetPath)

Given a localization target path, get the ID associated with it.

Note
This ID is unstable and should only be used for quick in-process comparison.

◆ GetLocalizedCultureNames()

TArray< FString > FTextLocalizationManager::GetLocalizedCultureNames ( const ELocalizationLoadFlags  InLoadFlags) const

Get a list of culture names that we have localized resource data for (ELocalizationLoadFlags controls which resources should be checked).

◆ GetLocalRevisionForTextId()

uint16 FTextLocalizationManager::GetLocalRevisionForTextId ( const FTextId InTextId) const

Attempts to find a local revision history for the given text ID. This will only be set if the display string has been changed since the localization manager version has been changed (eg, if it has been edited while keeping the same key).

Returns
The local revision, or 0 if there have been no changes since a global history change.

◆ GetNativeCultureName()

FString FTextLocalizationManager::GetNativeCultureName ( const ELocalizedTextSourceCategory  InCategory) const

Given a localization category, get the native culture for the category (if known).

Returns
The native culture for the given localization category, or an empty string if the native culture is unknown.

◆ GetRequestedLanguageName()

FString FTextLocalizationManager::GetRequestedLanguageName ( ) const

Get the language that will be requested during localization initialization, based on the hierarchy of: command line -> configs -> OS default.

◆ GetRequestedLocaleName()

FString FTextLocalizationManager::GetRequestedLocaleName ( ) const

Get the locale that will be requested during localization initialization, based on the hierarchy of: command line -> configs -> OS default.

◆ GetTextRevision()

UE_AUTORTFM_ALWAYS_OPEN uint16 FTextLocalizationManager::GetTextRevision ( ) const

Returns the current text revision number. This value can be cached when caching information from the text localization manager. If the revision does not match, cached information may be invalid and should be recached.

◆ GetTextRevisions()

UE_AUTORTFM_ALWAYS_OPEN void FTextLocalizationManager::GetTextRevisions ( const FTextId InTextId,
uint16 OutGlobalTextRevision,
uint16 OutLocalTextRevision 
) const

Get both the global and local revision for the given text ID.

See also
GetTextRevision and GetLocalRevisionForTextId.

◆ HandleLocalizationTargetsMounted()

void FTextLocalizationManager::HandleLocalizationTargetsMounted ( TArrayView< const FString >  LocalizationTargetPaths,
TUniqueFunction< void()> &&  Notification = nullptr 
)

Called when paths containing additional localization target data (LocRes) are mounted, to allow the display strings to dynamically update without waiting for a refresh.

Note
The loading is async, see WaitForAsyncTasks/NotifyWhenAsyncTasksCompleted, or pass the optional notification callback.
See also
FCoreDelegates::GatherAdditionalLocResPathsCallback.

◆ HandleLocalizationTargetsUnmounted()

void FTextLocalizationManager::HandleLocalizationTargetsUnmounted ( TArrayView< const FString >  LocalizationTargetPaths,
TUniqueFunction< void()> &&  Notification = nullptr 
)

Called when paths containing additional localization target data (LocRes) are unmounted, to allow the display strings to be unloaded.

Note
The unloading is async, see WaitForAsyncTasks/NotifyWhenAsyncTasksCompleted, or pass the optional notification callback.
See also
FCoreDelegates::GatherAdditionalLocResPathsCallback.

◆ IsDisplayStringSupportEnabled()

bool FTextLocalizationManager::IsDisplayStringSupportEnabled ( )
static

◆ NotifyWhenAsyncTasksCompleted()

void FTextLocalizationManager::NotifyWhenAsyncTasksCompleted ( TUniqueFunction< void()> &&  Notification)

Call the given function when any current async tasks have finished.

Note
The notification may be called from any thread, to avoid blocking other async tasks in the queue while waiting for a given thread to be available.
See also
WaitForAsyncTasks for a blocking version.

◆ RefreshResources()

void FTextLocalizationManager::RefreshResources ( TUniqueFunction< void()> &&  Notification = nullptr)

Reloads resources for the current culture.

Note
The loading is async, see WaitForAsyncTasks/NotifyWhenAsyncTasksCompleted, or pass the optional notification callback.

◆ RegisterPolyglotTextData() [1/2]

void FTextLocalizationManager::RegisterPolyglotTextData ( const FPolyglotTextData InPolyglotTextData,
const bool  InAddDisplayString = true 
)

Register a polyglot text data with the text localization manager.

◆ RegisterPolyglotTextData() [2/2]

void FTextLocalizationManager::RegisterPolyglotTextData ( TArrayView< const FPolyglotTextData InPolyglotTextDataArray,
const bool  InAddDisplayStrings = true 
)

◆ RegisterTextSource()

void FTextLocalizationManager::RegisterTextSource ( const TSharedRef< ILocalizedTextSource > &  InLocalizedTextSource,
const bool  InRefreshResources = true 
)

Register a localized text source with the text localization manager.

◆ ShouldForceLoadGameLocalization()

bool FTextLocalizationManager::ShouldForceLoadGameLocalization ( ) const

True if we should force load game localization data.

◆ TearDown()

void FTextLocalizationManager::TearDown ( )
static

◆ UE_NONCOPYABLE()

FTextLocalizationManager::UE_NONCOPYABLE ( FTextLocalizationManager  )

◆ UpdateFromLocalizationResource() [1/2]

void FTextLocalizationManager::UpdateFromLocalizationResource ( const FString &  LocalizationResourceFilePath)

Updates display string entries and adds new display string entries based on localizations found in a specified localization resource.

◆ UpdateFromLocalizationResource() [2/2]

void FTextLocalizationManager::UpdateFromLocalizationResource ( const FTextLocalizationResource TextLocalizationResource)

◆ WaitForAsyncTasks()

void FTextLocalizationManager::WaitForAsyncTasks ( )

Wait for any current async tasks to finish.

See also
NotifyWhenAsyncTasksCompleted for an non-blocking version.

Async tasks will be started for anything that loads localization data (eg, initialization, language changes, requests to refresh the localization data, requests to load additional localization data for chunked targets, or requests to load additional localization data for explicitly loaded plugins).

While the engine automatically waits at certain points during initialization, you may find that you need to add your own waits if you cause additional localization data to load post-initialization (eg, because you're using chunked localization targets or are explicitly loading plugins). A good place to add a wait in that case might be at the end of your loading screen, before showing your main menu or game world.

Friends And Related Symbol Documentation

◆ BeginInitTextLocalization

CORE_API void BeginInitTextLocalization ( )
friend

◆ BeginPreInitTextLocalization

CORE_API void BeginPreInitTextLocalization ( )
friend

◆ FLazySingleton

friend class FLazySingleton
friend

◆ InitEngineTextLocalization

CORE_API void InitEngineTextLocalization ( )
friend

◆ InitGameTextLocalization

CORE_API void InitGameTextLocalization ( )
friend

Member Data Documentation

◆ OnTextRevisionChangedEvent

FTextRevisionChangedEvent FTextLocalizationManager::OnTextRevisionChangedEvent

Event type for immediately reacting to changes in display strings for text.


The documentation for this class was generated from the following files: