implicit operator LocaleIdentifier(string)
Converts a culture code string into an identifier.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Operator
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
implicit operator LocaleIdentifier(LocaleIdentifie)
public static implicit operator LocaleIdentifier(string code)
Parameters
The culture code to convert.
Returns
Type | Description |
|---|---|
| LocaleIdentifier | An identifier for the given culture code. |
Remarks
Lets you assign a string wherever a LocaleIdentifier is expected. A null or empty string produces the undefined locale. Equivalent to calling LocaleIdentifier.
Assign a string to a LocaleIdentifier through the implicit conversion.
Examples
using Unity.Localization;namespace Unity.Localization.Samples{ public class LocaleIdentifierFromCodeExample { public LocaleIdentifier Run() { LocaleIdentifier identifier = "fr-CA"; // implicit conversion from string return identifier; } }}