Class CultureFlags
- Namespace
- BlazOrbit.Localization
- Assembly
- BlazOrbit.Core.dll
Default emoji flag lookup for the cultures most commonly used in BlazOrbit
localization. The BOBCultureSelector components in
BlazOrbit.Localization.Server / .Wasm call into this
when the consumer does not supply a custom FlagResolver.
public static class CultureFlags
- Inheritance
-
objectCultureFlags
Remarks
Emoji flags rely on the OS font set, so rendering varies (Windows is the
weakest); for SVG fidelity, supply a custom resolver via the component
parameter. The fallback when a culture is not mapped is 🌐.
Methods
GetFlag(CultureInfo)
System.Globalization.CultureInfo overload, useful when the consumer's
FlagResolver wants to delegate back to the default lookup.
public static string GetFlag(CultureInfo culture)
Parameters
cultureCultureInfo
Returns
- string
GetFlag(string?)
Convenience overload: returns the flag, falling back to 🌐.
public static string GetFlag(string? cultureName)
Parameters
cultureNamestring
Returns
- string
TryGetFlag(string?, out string)
Look up the flag for cultureName (e.g. en-US).
Returns false when the culture is not mapped, in
which case flag is set to the default globe glyph.
public static bool TryGetFlag(string? cultureName, out string flag)
Parameters
cultureNamestringflagstring
Returns
- bool