![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
Enumerations | |
| enum class | ETextCopyMethod : uint8 { NewKey , PreserveKey , Verbatim } |
| enum class | ETextEditAction : uint8 { Namespace , Key , SourceString } |
Variables | |
| constexpr TCHAR | PackageNamespaceStartMarker = TEXT('[') |
| constexpr TCHAR | PackageNamespaceEndMarker = TEXT(']') |
|
strong |
|
strong |
| FString TextNamespaceUtil::BuildFullNamespace | ( | const FString & | InTextNamespace, |
| const FString & | InPackageNamespace, | ||
| const bool | bAlwaysApplyPackageNamespace = false |
||
| ) |
Given a text and package namespace, build the full version that should be used by the localization system. This can also be used to "zero-out" the package namespace used by a text namespace (by passing an empty package namespace) while still leaving the package namespace markers in place.
| InTextNamespace | The namespace currently used by the FText instance. |
| InPackageNamespace | The namespace of the package owning the FText instance. |
| bAlwaysApplyPackageNamespace | If true, this will always apply the package namespace to the text namespace. If false, this will only apply the package namespace if the text namespace already contains package namespace markers. |
| FText TextNamespaceUtil::CopyTextToPackage | ( | const FText & | InText, |
| const FString & | InPackageNamespace, | ||
| const ETextCopyMethod | InCopyMethod = ETextCopyMethod::NewKey, |
||
| const bool | bAlwaysApplyPackageNamespace = false |
||
| ) |
Make a copy of the given text that's valid to use with the given package namespace, optionally preserving its existing key.
| InText | The current FText instance. |
| InPackageNamespace | The namespace of the destination package of the FText instance. |
| InCopyMethod | The method that should be used to copy the FText instance. |
| bAlwaysApplyPackageNamespace | If true, this will always apply the package namespace to the text namespace (always treated as ETextCopyMethod::Verbatim when USE_STABLE_LOCALIZATION_KEYS is false). If false, this will only apply the package namespace if the text namespace already contains package namespace markers. |
| FText TextNamespaceUtil::CopyTextToPackage | ( | const FText & | InText, |
| UObject * | InObject, | ||
| const ETextCopyMethod | InCopyMethod = ETextCopyMethod::NewKey, |
||
| const bool | bAlwaysApplyPackageNamespace = false |
||
| ) |
| FText TextNamespaceUtil::CopyTextToPackage | ( | const FText & | InText, |
| UPackage * | InPackage, | ||
| const ETextCopyMethod | InCopyMethod = ETextCopyMethod::NewKey, |
||
| const bool | bAlwaysApplyPackageNamespace = false |
||
| ) |
Make a copy of the given text that's valid to use with the given package, optionally preserving its existing key.
| InText | The current FText instance. |
| InPackage/InObject | The package (or object to get the owner package from) to get the namespace for (will call EnsurePackageNamespace). |
| InCopyMethod | The method that should be used to copy the FText instance. |
| bAlwaysApplyPackageNamespace | If true, this will always apply the package namespace to the text namespace (always treated as ETextCopyMethod::Verbatim when USE_STABLE_LOCALIZATION_KEYS is false). If false, this will only apply the package namespace if the text namespace already contains package namespace markers. |
| bool TextNamespaceUtil::EditTextProperty | ( | UObject * | InTextOwner, |
| const FTextProperty * | InTextProperty, | ||
| const ETextEditAction | InEditAction, | ||
| const FString & | InEditValue, | ||
| TFunctionRef< FString()> | InTextKeyGenerator = &GenerateRandomTextKey, |
||
| const bool | bApplyPackageNamespace = true |
||
| ) |
Edit an attribute of the given text property, akin to what happens when editing a text property in a details panel.
| InTextOwner | The object that owns the given TextProperty to be edited. |
| InTextProperty | The text property to edit. This must be a property that exists on TextOwner. |
| InEditAction | How has the given text been edited? |
| InEditValue | The new value of the attribute that was edited. |
| InTextKeyGenerator | Generator for the new text key. Will generate a random key by default. |
| bApplyPackageNamespace | If true, apply the package namespace to the generated text ID (when USE_STABLE_LOCALIZATION_KEYS is true). |
| bool TextNamespaceUtil::EditTextProperty_Direct | ( | UPackage * | InPackage, |
| void * | InTextValue, | ||
| const FTextProperty * | InTextProperty, | ||
| const ETextEditAction | InEditAction, | ||
| const FString & | InEditValue, | ||
| TFunctionRef< FString()> | InTextKeyGenerator = &GenerateRandomTextKey, |
||
| const bool | bApplyPackageNamespace = true |
||
| ) |
Edit an attribute of the given text property, akin to what happens when editing a text property in a details panel.
| InPackage | The package that hosts the text value. |
| InTextValue | The raw value of the TextProperty to be edited. |
| InTextProperty | The text property to edit. |
| InEditAction | How has the given text been edited? |
| InEditValue | The new value of the attribute that was edited. |
| InTextKeyGenerator | Generator for the new text key. Will generate a random key by default. |
| bApplyPackageNamespace | If true, apply the package namespace to the generated text ID (when USE_STABLE_LOCALIZATION_KEYS is true). |
| FString TextNamespaceUtil::ExtractPackageNamespace | ( | const FString & | InTextNamespace | ) |
Given a text namespace, extract any package namespace that may currently be present.
| InTextNamespace | The namespace currently used by the FText instance. |
| FString TextNamespaceUtil::GenerateDeterministicTextKey | ( | UObject * | InTextOwner, |
| const FName | InTextPropertyName, | ||
| const bool | bApplyPackageNamespace = true |
||
| ) |
| FString TextNamespaceUtil::GenerateDeterministicTextKey | ( | UObject * | InTextOwner, |
| const FTextProperty * | InTextProperty, | ||
| const bool | bApplyPackageNamespace = true |
||
| ) |
Generate a deterministic text key based on the given object and property info.
| InTextOwner | The object that owns the given TextProperty. |
| InTextProperty | The text property to generate the key for. |
| bApplyPackageNamespace | If true, apply the package namespace to the generated key hash (when USE_STABLE_LOCALIZATION_KEYS is true). |
| FString TextNamespaceUtil::GenerateRandomTextKey | ( | ) |
Generate a random text key.
| void TextNamespaceUtil::GetTextIdForEdit | ( | UPackage * | InPackage, |
| const ETextEditAction | InEditAction, | ||
| const FString & | InTextSource, | ||
| const FString & | InProposedNamespace, | ||
| const FString & | InProposedKey, | ||
| FString & | OutStableNamespace, | ||
| FString & | OutStableKey, | ||
| TFunctionRef< FString()> | InTextKeyGenerator = &GenerateRandomTextKey, |
||
| const bool | bApplyPackageNamespace = true |
||
| ) |
Called when editing a text property to determine the new ID for the text, ideally using the proposed text ID when possible (and when USE_STABLE_LOCALIZATION_KEYS is true).
| InPackage | The package to query the namespace for. |
| InEditAction | How has the given text been edited? |
| InTextSource | The current source string for the text being edited. Can be empty when InEditAction is ETextEditAction::SourceString. |
| InProposedNamespace | The namespace we'd like to assign to the edited text. |
| InProposedKey | The key we'd like to assign to the edited text. |
| OutStableNamespace | The namespace that should be assigned to the edited text. |
| OutStableKey | The key that should be assigned to the edited text. |
| InTextKeyGenerator | Generator for the new text key. Will generate a random key by default. |
| bApplyPackageNamespace | If true, apply the package namespace to the generated text ID (when USE_STABLE_LOCALIZATION_KEYS is true). |
| FString TextNamespaceUtil::StripPackageNamespace | ( | const FString & | InTextNamespace | ) |
Given a text namespace, strip any package namespace that may currently be present. This is similar to calling BuildFullNamespace with an empty package namespace, however this version will also remove the package namespace markers.
| InTextNamespace | The namespace currently used by the FText instance. |
| void TextNamespaceUtil::StripPackageNamespaceInline | ( | FString & | InOutTextNamespace | ) |