ILibLocale constructor
language the ISO 639 2-letter code for the language,
or a full locale spec in BCP-47 format, or another Locale instance to copy from
region the ISO 3166 2-letter code for the region
variant the name of the variant of this locale, if any
script the ISO 15924 code of the script for this locale, if any
Implementation
factory ILibLocale(
[Object? language, String? region, String? variant, String? script]) {
if (language is String) {
return ILibLocale._fromString(language, region, variant, script);
} else if (language is ILibLocale) {
return ILibLocale._fromILibLocale(language);
} else if (language == null) {
return ILibLocale._internal();
} else {
throw ArgumentError('Invalid input type. Expected String or ILibLocale.');
}
}