# AddEntry(IResourceEntry)

> Adds an entry, replacing any existing entry with the same key id.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public void AddEntry(IResourceEntry entry)
```

### Parameters

**** (\[IResourceEntry]\(/engine/6000.7/script-reference/unity/localization/iresourceentry)): The entry to add.

### Remarks

The entry must already carry a non-zero key id, so build it against a key that exists in [ResourceTable.SharedData](/engine/6000.7/script-reference/unity/localization/resourcetable/shareddata.md), for example one returned by [SharedTableData.AddKey](/engine/6000.7/script-reference/unity/localization/sharedtabledata/addkey.md). A `null` entry, or one whose key id is `0`, is ignored. To add a plain string without constructing the entry yourself, use [ResourceTable.AddStringEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/addstringentry.md).

Additional Resources: [ResourceTable.AddStringEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/addstringentry.md), [ResourceTable.RemoveEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/removeentry.md), [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md)

Add a shared key, then store a string entry for it in this locale.

### Examples

```csharp
using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class ResourceTableAddEntryExample
    {
        public void Run()
        {
            var shared = ScriptableObject.CreateInstance<SharedTableData>();
            var table = ScriptableObject.CreateInstance<ResourceTable>();
            table.SharedData = shared;
            table.LocaleIdentifier = "en";

            var key = shared.AddKey("Title");
            table.AddEntry(new StringEntry(key.Id, "Menu"));

            Debug.Log(table.GetEntry<IStringEntry>("Title").Value); // Menu
        }
    }
}
```
