UKismetTextLibrary::GetTextId
#include "Kismet/KismetTextLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Attempts to get the localization ID (namespace and key) used by the given text, returning whether an ID was found.
Caveats & Gotchas
- • Displayed in Blueprint as 'Get ID from Text'.
- • A found ID doesn't mean the text is translated — culture-invariant or programmatically constructed text can still carry a namespace/key pair without any localization data behind it.
- • OutNamespace can legitimately be an empty string even when the function returns true; don't treat an empty namespace as a failure signal.
Signature
static bool GetTextId(FText Text, FString& OutNamespace, FString& OutKey); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Text | FText | The text instance to inspect. | — |
| OutNamespace | FString& | Receives the localization namespace, which may be empty. | — |
| OutKey | FString& | Receives the localization key if found. | — |
Return Type
bool Example
Log the localization ID of a text asset C++
FString Namespace, Key;
if (UKismetTextLibrary::GetTextId(SomeText, Namespace, Key))
{
UE_LOG(LogTemp, Log, TEXT("Namespace: %s, Key: %s"), *Namespace, *Key);
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?