---
title: "preferredLocalizations(from:forPreferences:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/bundle/preferredlocalizations(from:forpreferences:)"
---

# preferredLocalizations(from:forPreferences:)

Returns locale identifiers for which a bundle would provide localized content, given a specified list of candidates for a user’s language preferences.

## Declaration

```swift
class func preferredLocalizations(from localizationsArray: [String], forPreferences preferencesArray: [String]?) -> [String]
```

## Parameters

- `localizationsArray`: An array of identifiers, each corresponding to a localization that a bundle can support.
- `preferencesArray`: An array of BCP 47 language codes corresponding to a user’s preferred languages. If this parameter is nil, the method uses the current user’s language preferences.

## Return Value

Return Value An array of locale identifiers, ordered according to user preference.  If none of the user-preferred localizations are available, this method returns one of the values in localizationsArray.

## Discussion

Discussion This method returns only the locale identifiers for which a bundle would  provide localized content. Typically, this means one of the following: A single localization that isn’t region-specific A region-specific localization, followed by a corresponding localization that isn’t region-specific, as a fallback This method doesn’t return all localizations in order of user preference. To get this information, you can call this method repeatedly, each time removing the identifiers returned by the previous call.

## See Also

### Getting localization information

- [localizations](foundation/bundle/localizations.md)
- [preferredLocalizations](foundation/bundle/preferredlocalizations.md)
- [developmentLocalization](foundation/bundle/developmentlocalization.md)
- [localizedInfoDictionary](foundation/bundle/localizedinfodictionary.md)
- [preferredLocalizations(from:)](foundation/bundle/preferredlocalizations(from:).md)
