Creates a locale with no culture code.
The parameterless constructor exists mainly for serialization. Because Locale.Code is read-only, prefer
Locale.Locale to create a usable locale. You can still set Locale.FallbackCode and
Locale.LocaleName after construction.
<para>Create an empty locale and set its fallback.</para>
using Unity.Localization;
namespace Unity.Localization.Samples { public class LocaleConstructorEmptyExample { public Locale Run() { var locale = new Locale(); locale.FallbackCode = "en"; return locale; } } }
| Parameter | Description |
|---|---|
| code | The culture code, for example "en" or "fr-CA". |
| localeName | The display name to show for this locale, or null to derive one from the culture. |
Creates a locale for a culture code, with an optional display name.
The culture code determines the Locale.Identifier and the formatting culture reported by
Locale.CultureInfo. When localeName is null, Locale.LocaleName falls back to the
culture's native name, then to the code itself.
<para>Create a locale for a culture code with an explicit display name.</para>