# How to update source string in string table programatically

**URL:** <https://forums.unrealengine.com/t/how-to-update-source-string-in-string-table-programatically/2016389>\
**Category:** Programming & Scripting\
**Tags:** c-c, c-class-wizard, c-and-bluepri, c-custommeshcomponen, c-and-blueprint, c-error, c-class, c-custom-shape, c-programming, c-cone-shape, unreal-engine, CPP, question\
**Created:** [September 11, 2024, 3:14pm UTC](https://forums.unrealengine.com/t/how-to-update-source-string-in-string-table-programatically/2016389 "2024-09-11T15:14:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NSzolnoki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NSzolnoki](https://forums.unrealengine.com/u/NSzolnoki)\
**Post date:** [September 11, 2024, 3:14pm UTC](https://forums.unrealengine.com/t/how-to-update-source-string-in-string-table-programatically/2016389/1 "2024-09-11T15:14:36Z")

</div>

We have a plugin for UE where the user can send source and gather translations from our system, but a new requirement is that the users want to update the source outside of UE.

I wrote this code:

````auto
void FGridlyLocalizationServiceProvider::UpdateStringTable()
{

	// Access the string table using FStringTableConstPtr
	FName TableID = FName(TEXT("/Game/strings/source_strings.source_strings"));

	FStringTableConstPtr StringTable = FStringTableRegistry::Get().FindStringTable(TableID);

	if (StringTable.IsValid())
	{
		FString Key = TEXT("on");
		FString NewSourceString = TEXT("Updated String Value");

		// Find the entry in the string table using FindEntry
		FStringTableEntryConstPtr Entry = StringTable->FindEntry(Key);

		if (Entry.IsValid())
		{
			// Retrieve the source string from the entry
			const FString& UpdatedValue = Entry->GetSourceString();
			UE_LOG(LogTemp, Log, TEXT("Updated string: %s"), *UpdatedValue);
		}
		else
		{
			UE_LOG(LogTemp, Warning, TEXT("Entry with key %s not found"), *Key);
		}
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("Could not find string table"));
	}
}```

But it always says that it can't find the string table.
What am I doing wrong, even if this possible to update the source programatically?
````

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [September 11, 2024, 3:49pm UTC](https://forums.unrealengine.com/t/how-to-update-source-string-in-string-table-programatically/2016389/2 "2024-09-11T15:49:38Z")

</div>

I don’t have the editor in front of me at the moment to check but this smells of an asset registry issue. Have you added the string table/path to your asset manager?

Here’s an old post on the subject. It’s not exactly your problem as it’s in BP but it might give you some leads.

[String Tables not loaded at start - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)](https://forums.unrealengine.com/t/string-tables-not-loaded-at-start/115171)

---

<div class="post-metadata">

**Author:** ![NSzolnoki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NSzolnoki](https://forums.unrealengine.com/u/NSzolnoki)\
**Post date:** [September 12, 2024, 7:52am UTC](https://forums.unrealengine.com/t/how-to-update-source-string-in-string-table-programatically/2016389/3 "2024-09-12T07:52:37Z")

</div>

Hey, thank you!  
I already read that topic, but I don’t run the game, this is a plugin that we use to do the localization, so even if I add a blueprint it won’t apply, because the game is not running when I work in the localization dashboard.
