---
title: "CFLocaleCreateLocaleIdentifierFromComponents(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cflocalecreatelocaleidentifierfromcomponents(_:_:)"
---

# CFLocaleCreateLocaleIdentifierFromComponents(_:_:)

Returns a locale identifier consisting of language, script, country or region, variant, and keyword/value pairs derived from a dictionary containing the source information.

## Declaration

```swift
func CFLocaleCreateLocaleIdentifierFromComponents(_ allocator: CFAllocator!, _ dictionary: CFDictionary!) -> CFLocaleIdentifier!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `dictionary`: The dictionary to use when creating the locale identifier.

## Return Value

Return Value A locale identifier consisting of language, script, country or region, variant, and keyword/value pairs derived from dictionary. Returns NULL if there was a problem creating the string. Ownership follows the The Create Rule.

## Discussion

Discussion Reverses the actions of CFLocaleCreateComponentsFromLocaleIdentifier(_:_:), creating a single string from the data in the specified dictionary. For example, the dictionary {kCFLocaleLanguageCode``=en``, kCFLocaleCountryCode``=US``, kCFLocaleCalendarIdentifier``=``kCFJapaneseCalendar``} becomes "en_US@calendar=japanese".

## See Also

### Getting and Creating Locale Identifiers

- [CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:)](corefoundation/cflocalecreatecanonicallocaleidentifierfromscriptmanagercodes(_:_:_:).md)
- [CFLocaleCreateCanonicalLanguageIdentifierFromString(_:_:)](corefoundation/cflocalecreatecanonicallanguageidentifierfromstring(_:_:).md)
- [CFLocaleCreateCanonicalLocaleIdentifierFromString(_:_:)](corefoundation/cflocalecreatecanonicallocaleidentifierfromstring(_:_:).md)
- [CFLocaleCreateComponentsFromLocaleIdentifier(_:_:)](corefoundation/cflocalecreatecomponentsfromlocaleidentifier(_:_:).md)
- [CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(_:_:)](corefoundation/cflocalecreatelocaleidentifierfromwindowslocalecode(_:_:).md)
- [CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(_:)](corefoundation/cflocalegetwindowslocalecodefromlocaleidentifier(_:).md)
