# GetLocalizedStringAsync(TableReference, TableEntryReference, Locale, object[], CancellationToken, bool, IVariableGroup)

> Resolves a localized string, applying Smart formatting and the locale post-processing hook.

## Definition

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

## GetLocalizedStringAsync(TableReference, TableEntryReference, Locale, Object\[], CancellationToken, bool, IVariableGroup)

```csharp
public Awaitable<string> GetLocalizedStringAsync(TableReference tableRef, TableEntryReference entryRef, Locale locale = null, object[] args = null, CancellationToken cancellationToken = default, bool enableFallback = true, IVariableGroup localVariables = null)
```

### Parameters

**** (\[TableReference]\(/engine/6000.7/script-reference/unity/localization/tablereference)): The reference to the table collection that holds the entry.**** (\[TableEntryReference]\(/engine/6000.7/script-reference/unity/localization/tableentryreference)): The reference to the string entry to resolve.**** (\[Locale]\(/engine/6000.7/script-reference/unity/localization/locale)): The locale to resolve in; null uses the selected locale.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): The Smart String arguments to format placeholders with; null when the entry takes no arguments.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): The token that cancels the load operation.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to walk the locale fallback chain when the locale has no value.**** (\[IVariableGroup]\(/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/ivariablegroup)): The extra variables that Smart String placeholders resolve against, in addition to the arguments.

### Returns

| Type                                                                           | Description                                                                                   |
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| [Awaitable\<string>](/engine/6000.7/script-reference/unityengine/awaitable.md) | The formatted localized string, or null when the entry is not a string entry or has no value. |

### Remarks

The entry loads through the provider chain, following the locale fallback chain when `enableFallback` is true. When the entry is marked as Smart, the value is formatted with the settings' Smart formatter (see [LocalizationSettings.GetSmartFormatter](/engine/6000.7/script-reference/unity/localization/localizationsettings/getsmartformatter.md)) using `args` and `localVariables`. The result is then passed through the locale's post-processing hook, which pseudo-locales use to transform text. To read an already-loaded value without awaiting, use [ResourceDatabase.GetLocalizedString](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedstring.md).

Resolves a Smart String that inserts the player's score.

### Examples

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

namespace Unity.Localization.Samples
{
    public class GetLocalizedStringWithArgsExample : MonoBehaviour
    {
        async void Start()
        {
            // Entry "score-message" is a Smart entry: "You scored {0} points"
            string message = await LocalizationSettings.ResourceDatabase
                .GetLocalizedStringAsync("UI Text", "score-message", args: new object[] { 42 });
            Debug.Log(message);
        }
    }
}
```
