UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPackageLocalizationUtil Struct Reference

#include <PackageLocalizationUtil.h>

Static Public Member Functions

static COREUOBJECT_API bool ConvertLocalizedToSource (const FStringView &InLocalized, FString &OutSource)
 
static COREUOBJECT_API void ConvertToSource (const FStringView &InPath, FString &OutSource)
 
static COREUOBJECT_API bool ConvertSourceToLocalized (const FStringView &InSource, const FStringView &InCulture, FString &OutLocalized)
 
static COREUOBJECT_API bool ConvertSourceToRegexLocalized (const FStringView &InSource, FString &OutLocalized)
 
static COREUOBJECT_API bool GetLocalizedRoot (const FString &InPath, const FString &InCulture, FString &OutLocalized)
 
static COREUOBJECT_API bool ExtractCultureFromLocalized (const FStringView &InLocalized, FString &OutCulture)
 
static COREUOBJECT_API void GetLocalizedVariantsAbsolutePaths (const FStringView &InSource, TArray< FString > &OutLocalizedAbsolutePaths)
 

Detailed Description

Utility functions for dealing with localized package names

Member Function Documentation

◆ ConvertLocalizedToSource()

bool FPackageLocalizationUtil::ConvertLocalizedToSource ( const FStringView InLocalized,
FString &  OutSource 
)
static

Converts a localized version of a package path to the source version (by removing /L10N/ from the package path) Note: This does not check whether the source package exists

Parameters
InLocalizedPath to the localized package.
OutSourcePath to the source package. If the conversion failed, OutSource won't change.
Returns
True if the conversion happened, false otherwise (it will fail it the input was not a localized variant)

◆ ConvertSourceToLocalized()

bool FPackageLocalizationUtil::ConvertSourceToLocalized ( const FStringView InSource,
const FStringView InCulture,
FString &  OutLocalized 
)
static

Converts a source version of a package path to the localized version for the given culture (by adding /L10N/ to the package path) Note: This does not check whether the source package exists

Parameters
InSourcePath to the source package.
InCultureCulture code to use.
OutLocalizedPath to the localized package. If the conversion failed, OutLocalized won't change.
Returns
True if the conversion happened, false otherwise

◆ ConvertSourceToRegexLocalized()

bool FPackageLocalizationUtil::ConvertSourceToRegexLocalized ( const FStringView InSource,
FString &  OutLocalized 
)
static

Converts a source version of a package path to the regex localized version (by adding "/L10N/" + "*" to the package path) Note: This does not check whether the source package exists

Parameters
InSourcePath to the source package.
OutLocalizedPath to the regex localized package. If the conversion failed, OutLocalized won't change.
Returns
True if the conversion happened, false otherwise

◆ ConvertToSource()

void FPackageLocalizationUtil::ConvertToSource ( const FStringView InPath,
FString &  OutSource 
)
static

Convert a package path to its source version (by removing /L10N/ from the package path, if present) Note: This does not check whether the source package exists

Parameters
InPathPath to a package. It can be a source asset already or a localized variant.
OutSourcePath to the source package. It cannot fail. If no /L10N/ were found, it is already a Source Asset.

◆ ExtractCultureFromLocalized()

bool FPackageLocalizationUtil::ExtractCultureFromLocalized ( const FStringView InLocalized,
FString &  OutCulture 
)
static

Extract a culture code from a localized version of a package path (by finding /L10N/ from the package path, if present) Note: This does not check whether the source package exists

Parameters
InLocalizedPath to the localized package.
OutCultureCulture code (found from /L10N/)
Returns
True if the conversion happened, false otherwise

◆ GetLocalizedRoot()

bool FPackageLocalizationUtil::GetLocalizedRoot ( const FString &  InPath,
const FString &  InCulture,
FString &  OutLocalized 
)
static

Given a package path, get the localized root package for the given culture (eg, if given "/Game/MyFolder/MyAsset" and a culture of "fr", this would return "/Game/L10N/fr")

Parameters
InPathPackage path to use.
InCultureCulture code to use (if any).
OutLocalizedLocalized package root.
Returns
True if the conversion happened, false otherwise

◆ GetLocalizedVariantsAbsolutePaths()

void FPackageLocalizationUtil::GetLocalizedVariantsAbsolutePaths ( const FStringView InSource,
TArray< FString > &  OutLocalizedAbsolutePaths 
)
static

Given a package path, returns all localized variants absolute paths found on disk Note: There is a similar function to check in Revision Control (if not on disk) (see USourceControlHelpers::GetLocalizedVariantsAbsolutePaths)

Parameters
InPackageNamePackage path to use.
OutLocalizedAbsolutePathsAbsolute paths of localized variants founds

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