UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPackageLocalizationCache Class Referenceabstract

#include <PackageLocalizationCache.h>

+ Inheritance diagram for FPackageLocalizationCache:

Public Member Functions

COREUOBJECT_API FPackageLocalizationCache ()
 
virtual COREUOBJECT_API ~FPackageLocalizationCache ()
 
virtual COREUOBJECT_API void InvalidateRootSourcePath (const FString &InRootPath) override
 
virtual COREUOBJECT_API void ConditionalUpdateCache () override
 
virtual COREUOBJECT_API FName FindLocalizedPackageName (const FName InSourcePackageName) override
 
virtual COREUOBJECT_API FName FindLocalizedPackageNameForCulture (const FName InSourcePackageName, const FString &InCultureName) override
 
- Public Member Functions inherited from IPackageLocalizationCache
virtual ~IPackageLocalizationCache ()
 

Protected Member Functions

virtual void FindLocalizedPackages (const TMap< FString, TArray< FString > > &NewSourceToLocalizedPaths, TMap< FName, TArray< FName > > &InOutSourcePackagesToLocalizedPackages)=0
 
virtual void FindAssetGroupPackages (const FName InAssetGroupName, const FTopLevelAssetPath &InAssetClassName)=0
 
COREUOBJECT_API TSharedPtr< FPackageLocalizationCultureCacheFindOrAddCacheForCulture_NoLock (const FString &InCultureName)
 
COREUOBJECT_API void ConditionalUpdatePackageNameToAssetGroupCache_NoLock ()
 
COREUOBJECT_API void HandleContentPathMounted (const FString &InAssetPath, const FString &InFilesystemPath)
 
COREUOBJECT_API void HandleContentPathDismounted (const FString &InAssetPath, const FString &InFilesystemPath)
 
COREUOBJECT_API void HandleCultureChanged ()
 

Protected Attributes

FCriticalSection LocalizedCachesCS
 
TSharedPtr< FPackageLocalizationCultureCacheCurrentCultureCache
 
TArray< TTuple< FString, TSharedPtr< FPackageLocalizationCultureCache > > > AllCultureCaches
 
TArray< TTuple< FTopLevelAssetPath, FName > > AssetClassesToAssetGroups
 
TMap< FName, FNamePackageNameToAssetGroup
 
bool bPackageNameToAssetGroupDirty
 

Friends

class FPackageLocalizationCultureCache
 

Detailed Description

Common implementation for the package localization cache

Constructor & Destructor Documentation

◆ FPackageLocalizationCache()

FPackageLocalizationCache::FPackageLocalizationCache ( )

◆ ~FPackageLocalizationCache()

FPackageLocalizationCache::~FPackageLocalizationCache ( )
virtual

Member Function Documentation

◆ ConditionalUpdateCache()

void FPackageLocalizationCache::ConditionalUpdateCache ( )
overridevirtual

Update this cache, but only if it is dirty.

Implements IPackageLocalizationCache.

◆ ConditionalUpdatePackageNameToAssetGroupCache_NoLock()

void FPackageLocalizationCache::ConditionalUpdatePackageNameToAssetGroupCache_NoLock ( )
protected

Update the mapping of package names to asset groups (if required).

◆ FindAssetGroupPackages()

virtual void FPackageLocalizationCache::FindAssetGroupPackages ( const FName  InAssetGroupName,
const FTopLevelAssetPath InAssetClassName 
)
protectedpure virtual

Find all of the packages using the given asset group class, and update the PackageNameToAssetGroup map with the result.

Parameters
InAssetGroupNameThe name of the asset group packages of this type belong to.
InAssetClassNameThe name of a class used by this asset group.

Implemented in FDefaultPackageLocalizationCache, and FEnginePackageLocalizationCache.

◆ FindLocalizedPackageName()

FName FPackageLocalizationCache::FindLocalizedPackageName ( const FName  InSourcePackageName)
overridevirtual

Try and find the localized package name for the given source package for the active culture.

Parameters
InSourcePackageNameThe name of the source package to find.
Returns
The localized package name, or NAME_None if there is no localized package.

Implements IPackageLocalizationCache.

◆ FindLocalizedPackageNameForCulture()

FName FPackageLocalizationCache::FindLocalizedPackageNameForCulture ( const FName  InSourcePackageName,
const FString &  InCultureName 
)
overridevirtual

Try and find the localized package name for the given source package for the given culture.

Parameters
InSourcePackageNameThe name of the source package to find.
InCultureNameThe name of the culture to find the package for.
Returns
The localized package name, or NAME_None if there is no localized package.

Implements IPackageLocalizationCache.

◆ FindLocalizedPackages()

virtual void FPackageLocalizationCache::FindLocalizedPackages ( const TMap< FString, TArray< FString > > &  NewSourceToLocalizedPaths,
TMap< FName, TArray< FName > > &  InOutSourcePackagesToLocalizedPackages 
)
protectedpure virtual

Find all of the localized packages under the given roots, and update the map with the result.

Parameters
NewSourceToLocalizedPathsMap containing a key for each of the the source root paths we're finding localized packages for, e.g. /Game The value for each key is an array of the roots to search for localized packages for that source, e.g. { /Game/L10/hu, /Game/L10/fr }
InOutSourcePackagesToLocalizedPackagesThe map to update. This will accumulate results from each root in order to build a mapping between each source package and its array of prioritized localized packages.

Implemented in FDefaultPackageLocalizationCache, and FEnginePackageLocalizationCache.

◆ FindOrAddCacheForCulture_NoLock()

TSharedPtr< FPackageLocalizationCultureCache > FPackageLocalizationCache::FindOrAddCacheForCulture_NoLock ( const FString &  InCultureName)
protected

Try and find an existing cache for the given culture name, and create an entry for one if no such cache currently exists.

Parameters
InCultureNameThe name of the culture to find the cache for.
Returns
A pointer to the cache for the given culture.

◆ HandleContentPathDismounted()

void FPackageLocalizationCache::HandleContentPathDismounted ( const FString &  InAssetPath,
const FString &  InFilesystemPath 
)
protected

Callback handler for when an existing content path is dismounted.

Parameters
InAssetPathThe package path that was dismounted, eg) /Game
InFilesystemPathThe file-system path for the asset path, eg) ../../../MyGame/Content

◆ HandleContentPathMounted()

void FPackageLocalizationCache::HandleContentPathMounted ( const FString &  InAssetPath,
const FString &  InFilesystemPath 
)
protected

Callback handler for when a new content path is mounted.

Parameters
InAssetPathThe package path that was mounted, eg) /Game
InFilesystemPathThe file-system path for the asset path, eg) ../../../MyGame/Content

◆ HandleCultureChanged()

void FPackageLocalizationCache::HandleCultureChanged ( )
protected

Callback handler for when the active culture is changed.

◆ InvalidateRootSourcePath()

void FPackageLocalizationCache::InvalidateRootSourcePath ( const FString &  InRootPath)
overridevirtual

Invalidate any cached state for the given root source path, and add it to the queue of things to process when ConditionalUpdateCache is called. eg) when new asset registry state is loaded for a plugin that may invalidate its cached data

Implements IPackageLocalizationCache.

Friends And Related Symbol Documentation

◆ FPackageLocalizationCultureCache

Member Data Documentation

◆ AllCultureCaches

TArray<TTuple<FString, TSharedPtr<FPackageLocalizationCultureCache> > > FPackageLocalizationCache::AllCultureCaches
protected

Mapping between a culture name, and the culture specific cache for that culture.

◆ AssetClassesToAssetGroups

TArray<TTuple<FTopLevelAssetPath, FName> > FPackageLocalizationCache::AssetClassesToAssetGroups
protected

Mapping between a class name, and the asset group the class belongs to (for class specific package localization).

◆ bPackageNameToAssetGroupDirty

bool FPackageLocalizationCache::bPackageNameToAssetGroupDirty
protected

◆ CurrentCultureCache

TSharedPtr<FPackageLocalizationCultureCache> FPackageLocalizationCache::CurrentCultureCache
protected

Pointer to the culture specific cache for the current culture.

◆ LocalizedCachesCS

FCriticalSection FPackageLocalizationCache::LocalizedCachesCS
mutableprotected

Critical section preventing concurrent access to our data.

◆ PackageNameToAssetGroup

TMap<FName, FName> FPackageLocalizationCache::PackageNameToAssetGroup
protected

Mapping between a package name, and the asset group it belongs to.


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