"Type Mismatch" while assigning Fallback Locale

Hello,

I’m trying to assign a fallback locale to a locale in script using

locale.Metadata.AddMetadata(new FallbackLocale(Locale.CreateLocale(fallbackLocale)));

In editor, fallback locale is assigned to the locale but it says “Type Mismatch”.

Is there something wrong I am doing?

The Locale needs to be persistent. Doing Locale.CreateLocale(fallbackLocale) will create a Locale in memory that will be destroyed at some point. Likely causing the type mismatch.
You should assign a Locale asset. Create one in the project and then get to it with LocalizationEditorSettings.GetLocale.

1 Like

Thank you Karl, that solved my problem.

1 Like