LanguageAvailability
A check for language support and status.
Declaration
class LanguageAvailabilityOverview
Use this class to check and see whether the framework supports the language or language pairing you want to offer as a translation. For example, to check if someone’s device supports a translation you can do the following:
func translationIsSupported(from source: Locale.Language, to target: Locale.Language) async -> Bool {
let availability = LanguageAvailability()
let status = await availability.status(from: source, to: target)
switch status {
case .installed, .supported:
return true
case .unsupported
return false
}
}