<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Translation",
  "identifier" : "/documentation/Translation/TranslationSession/Configuration/init(source:target:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Translation"
    ],
    "preciseIdentifier" : "s:11Translation0A7SessionC13ConfigurationV6source6targetAE10Foundation6LocaleV8LanguageVSg_AMtcfc"
  },
  "title" : "init(source:target:)"
}
-->

# init(source:target:)

Creates a configuration from a source and target language.

```
init(source: Locale.Language? = nil, target: Locale.Language? = nil)
```

## Parameters

`source`

The language the source content is in. If `nil` the 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 `nil` the session tries to
pick a target language according to the person’s <doc://com.apple.documentation/documentation/Foundation/Locale/preferredLanguages>,
and the `source`.

## Discussion

When creating a translation session configuration
it’s best to use `Locale.Language` values that return from
[`supportedLanguages`](/documentation/Translation/LanguageAvailability/supportedLanguages).
When you pass other `Locale.Language` values, the framework tries to match to one of
these supported languages.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)