# EvaluateStartupLocale(Func<IStartupLocaleSelector, bool>)

> Runs the startup selector chain and returns the locale it produces, without selecting it.

## Definition

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

```csharp
public Locale EvaluateStartupLocale(Func<IStartupLocaleSelector, bool> filter = null)
```

### Parameters

**** (\[Func\<IStartupLocaleSelector, bool>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Returns true for each selector to evaluate, or null to evaluate them all.

### Returns

| Type                                                                   | Description                                                                    |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [Locale](/engine/6000.7/script-reference/unity/localization/locale.md) | The locale the chain produces, or null when there is no project locale either. |

### Remarks

This is the same evaluation [LocalizationSettings.InitializeAsync](/engine/6000.7/script-reference/unity/localization/localizationsettings/initializeasync.md) performs, so the result is directly comparable with [LocalizationSettings.SelectedLocale](/engine/6000.7/script-reference/unity/localization/localizationsettings/selectedlocale.md). Pass a filter to leave selectors out: excluding the one that applies a saved user choice gives the locale the project would have started with, which is the value to show as the default and to restore when the user resets. Falls back to [LocalizationSettings.ProjectLocale](/engine/6000.7/script-reference/unity/localization/localizationsettings/projectlocale.md) when no selector matches. Selectors are asked again on every call, so a selector with side effects sees more than one call.

Additional Resources: [LocalizationSettings.StartupSelector](/engine/6000.7/script-reference/unity/localization/localizationsettings/startupselector.md), [LocalizationSettings.StartupSelectors](/engine/6000.7/script-reference/unity/localization/localizationsettings/startupselectors.md)

Show the saved language alongside the one the project would otherwise start in.

### Examples

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

namespace Unity.Localization.Samples
{
    public class EvaluateStartupLocaleExample : MonoBehaviour
    {
        void Start()
        {
            var settings = LocalizationSettings.Instance;

            // What the project would start in with the saved choice ignored, for a "Reset to default" button.
            var fallback = settings.EvaluateStartupLocale(selector => selector is not PlayerPrefLocaleSelector);

            Debug.Log($"Playing in {LocalizationSettings.SelectedLocale?.LocaleName}, default is {fallback?.LocaleName}");
            if (settings.StartupSelector is PlayerPrefLocaleSelector)
                Debug.Log("The language came from a saved choice rather than the project default.");
        }

        public void ResetToDefault()
        {
            var settings = LocalizationSettings.Instance;
            LocalizationSettings.SelectedLocale =
                settings.EvaluateStartupLocale(selector => selector is not PlayerPrefLocaleSelector);
        }
    }
}
```
