init(source:target:)
Creates a configuration from a source and target language.
Declaration
init(source: Locale.Language? = nil, target: Locale.Language? = nil)Parameters
- source:
The language the source content is in. If
nilthe session tries to identify the language, and prompt the person to pick the source language if it’s unclear. All text translated with this session should be in the same source language. - target:
The language to translate content into. If
nilthe session tries to pick a target language according to the person’s Preferredlanguages, and thesource.
Discussion
When creating a translation session configuration it’s best to use Locale.Language values that return from supportedLanguages. When you pass other Locale.Language values, the framework tries to match to one of these supported languages.