# ResourceDatabase

> Resolves localized strings and assets for the active localization settings.

## Definition

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

```csharp
public class ResourceDatabase
```

## Remarks

A resource database owns an [AssetProvider](/engine/6000.7/script-reference/unity/localization/providers/assetprovider.md) chain and an internal per-locale asset cache. Access the active database through [LocalizationSettings.Database](/engine/6000.7/script-reference/unity/localization/localizationsettings/database.md). Tables load through the provider chain like any other asset (the database keeps no table list), so use the reference types [TableReference](/engine/6000.7/script-reference/unity/localization/tablereference.md) and [TableEntryReference](/engine/6000.7/script-reference/unity/localization/tableentryreference.md) to identify what to resolve. String entries flagged as Smart are formatted through the settings' Smart formatter (see [LocalizationSettings.GetSmartFormatter](/engine/6000.7/script-reference/unity/localization/localizationsettings/getsmartformatter.md)), and resolved values pass through the locale's post-processing hook, which pseudo-locales use to transform text. Each resolve method has an asynchronous form that loads on demand and a synchronous form that reads only already-loaded tables. Missing or empty entries follow the locale fallback chain defined by [Locale.FallbackCode](/engine/6000.7/script-reference/unity/localization/locale/fallbackcode.md).

Additional Resources: [LocalizationSettings](/engine/6000.7/script-reference/unity/localization/localizationsettings.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md), [TableReference](/engine/6000.7/script-reference/unity/localization/tablereference.md), [TableEntryReference](/engine/6000.7/script-reference/unity/localization/tableentryreference.md), [LocalizedString](/engine/6000.7/script-reference/unity/localization/localizedstring.md), [Locale](/engine/6000.7/script-reference/unity/localization/locale.md), [AssetProvider](/engine/6000.7/script-reference/unity/localization/providers/assetprovider.md)

Resolves a localized string in the selected locale.

## Examples

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

namespace Unity.Localization.Samples
{
    public class ResolveLocalizedStringExample : MonoBehaviour
    {
        async void Start()
        {
            ResourceDatabase database = LocalizationSettings.ResourceDatabase;
            string text = await database.GetLocalizedStringAsync("UI Text", "hello");
            Debug.Log(text);
        }
    }
}
```

## Properties

| Property                                                                                              | Description                                                  |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [AssetProvider](/engine/6000.7/script-reference/unity/localization/resourcedatabase/assetprovider.md) | The provider chain used to load tables and localized assets. |

## Methods

| Method                                                                                                                    | Description                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| [GetEntry](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getentry.md)                               | Resolves an entry synchronously, following the fallback chain, or null when an async load is required.      |
| [GetEntryAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getentryasync.md)                     | Resolves an entry, following the locale fallback chain when the entry is missing or empty.                  |
| [GetLocalizedAsset](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedasset.md)             | Resolves a localized asset synchronously from a synchronous provider and entry.                             |
| [GetLocalizedAssetAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedassetasync.md)   | Resolves a localized asset: the direct reference when present, otherwise through the provider chain.        |
| [GetLocalizedString](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedstring.md)           | Resolves a localized string synchronously, or null when it cannot be resolved without an asynchronous load. |
| [GetLocalizedStringAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedstringasync.md) | Resolves a localized string, applying Smart formatting and the locale post-processing hook.                 |
| [GetTable](/engine/6000.7/script-reference/unity/localization/resourcedatabase/gettable.md)                               | Returns the resource table for a reference if it is already loaded, or null otherwise.                      |
| [GetTableAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/gettableasync.md)                     | Loads the resource table for a table reference in a locale through the provider chain.                      |
| [ReleaseAllAssets](/engine/6000.7/script-reference/unity/localization/resourcedatabase/releaseallassets.md)               | Releases every cached asset across all locales.                                                             |
| [ReleaseAssets](/engine/6000.7/script-reference/unity/localization/resourcedatabase/releaseassets.md)                     | Releases every cached asset loaded for the given locale.                                                    |
