supportedLocale(equivalentTo:)
A locale from the module’s supported locales equivalent to the given locale.
Declaration
static func supportedLocale(equivalentTo locale: Locale) async -> Locale?Parameters
- locale:
An arbitrary locale.
Return Value
A locale in the supported locales list, or nil if there is no equivalent locale in that list.
Discussion
Use this method to determine which of this module’s supported locales is equivalent to an arbitrary locale such as Locale.current.
If there is no exact equivalent, this method will return a near-equivalent: a supported (and by preference already-installed) locale that shares the same Locale.LanguageCode value but has a different Locale.Region value. This may result in an unexpected transcription, such as between “color” and “colour”.