<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFLocale",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFLocaleRef"
  },
  "title" : "CFLocale"
}
-->

# CFLocale

```
class CFLocale
```

## Overview

Unicode operations such as collation and text boundary determination can be affected by the conventions of a particular language or region. CFLocale objects specify language-specific or region-specific information for locale-sensitive operations.

The CFLocale opaque type provides support for obtaining available locales, obtaining localized locale names, and converting among locale data formats. Locale identifiers in macOS follow the IETF’s [BCP 47](http://www.rfc-editor.org/rfc/bcp/bcp47.txt). CFLocale never uses Script Manager codes (except for the legacy support provided by [`CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:)`](/documentation/CoreFoundation/CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:)))—the Script Manager and all its concepts are deprecated.

For more information on locale identifiers, read [Internationalization and Localization Guide](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/Introduction/Introduction.html#//apple_ref/doc/uid/10000171i). It is also useful to read the ICU’s [User Guide for the Locale Class](http://icu-project.org/userguide/locale.html).

CFLocale is “toll-free bridged” with its Cocoa Foundation counterpart, <doc://com.apple.documentation/documentation/Foundation/NSLocale>. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an `NSLocale *` parameter, you can pass in a `CFLocaleRef`, and in a function where you see a `CFLocaleRef` parameter, you can pass in an `NSLocale` instance. See [Toll-Free Bridged Types](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFDesignConcepts/Articles/tollFreeBridgedTypes.html#//apple_ref/doc/uid/TP40010677) for more information on toll-free bridging.

## Topics

### Creating a Locale

[`CFLocaleCopyCurrent()`](/documentation/CoreFoundation/CFLocaleCopyCurrent())

Returns a copy of the logical locale for the current user.

[`CFLocaleCreate(_:_:)`](/documentation/CoreFoundation/CFLocaleCreate(_:_:))

Creates a locale for the given arbitrary locale identifier.

[`CFLocaleCreateCopy(_:_:)`](/documentation/CoreFoundation/CFLocaleCreateCopy(_:_:))

Returns a copy of a locale.

[`CFLocaleGetSystem()`](/documentation/CoreFoundation/CFLocaleGetSystem())

Returns the root, canonical locale.

### Getting System Locale Information

[`CFLocaleCopyAvailableLocaleIdentifiers()`](/documentation/CoreFoundation/CFLocaleCopyAvailableLocaleIdentifiers())

Returns an array of CFString objects that represents all locales for which locale data is available.

### Getting ISO Information

[`CFLocaleCopyISOCountryCodes()`](/documentation/CoreFoundation/CFLocaleCopyISOCountryCodes())

Returns an array of CFString objects that represents all known legal ISO country codes.

[`CFLocaleCopyISOLanguageCodes()`](/documentation/CoreFoundation/CFLocaleCopyISOLanguageCodes())

Returns an array of CFString objects that represents all known legal ISO language codes.

[`CFLocaleCopyISOCurrencyCodes()`](/documentation/CoreFoundation/CFLocaleCopyISOCurrencyCodes())

Returns an array of CFString objects that represents all known legal ISO currency codes.

[`CFLocaleCopyCommonISOCurrencyCodes()`](/documentation/CoreFoundation/CFLocaleCopyCommonISOCurrencyCodes())

Returns an array of strings that represents ISO currency codes for currencies in common use.

### Language Preferences

[`CFLocaleCopyPreferredLanguages()`](/documentation/CoreFoundation/CFLocaleCopyPreferredLanguages())

Returns the array of canonicalized language IDs that the user prefers.

### Getting Information About a Locale

[`CFLocaleCopyDisplayNameForPropertyValue(_:_:_:)`](/documentation/CoreFoundation/CFLocaleCopyDisplayNameForPropertyValue(_:_:_:))

Returns the display name for the given value.

[`CFLocaleGetValue(_:_:)`](/documentation/CoreFoundation/CFLocaleGetValue(_:_:))

Returns the corresponding value for the given key of a locale’s key-value pair.

[`CFLocaleGetIdentifier(_:)`](/documentation/CoreFoundation/CFLocaleGetIdentifier(_:))

Returns the given locale’s identifier.

### Getting and Creating Locale Identifiers

[`CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:)`](/documentation/CoreFoundation/CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:))

Returns a canonical locale identifier from given language and region codes.

[`CFLocaleCreateCanonicalLanguageIdentifierFromString(_:_:)`](/documentation/CoreFoundation/CFLocaleCreateCanonicalLanguageIdentifierFromString(_:_:))

Returns a canonical language identifier by mapping an arbitrary locale identification string to the canonical identifier

[`CFLocaleCreateCanonicalLocaleIdentifierFromString(_:_:)`](/documentation/CoreFoundation/CFLocaleCreateCanonicalLocaleIdentifierFromString(_:_:))

Returns a canonical locale identifier by mapping an arbitrary locale identification string to the canonical identifier.

[`CFLocaleCreateComponentsFromLocaleIdentifier(_:_:)`](/documentation/CoreFoundation/CFLocaleCreateComponentsFromLocaleIdentifier(_:_:))

Returns a dictionary containing the result from parsing a locale ID consisting of language, script, country or region, variant, and keyword/value pairs.

[`CFLocaleCreateLocaleIdentifierFromComponents(_:_:)`](/documentation/CoreFoundation/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.

[`CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(_:_:)`](/documentation/CoreFoundation/CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(_:_:))

Returns a locale identifier from a Windows locale code.

[`CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(_:)`](/documentation/CoreFoundation/CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(_:))

Returns a Windows locale code from the locale identifier.

### Getting Line and Character Direction for a Language

[`CFLocaleGetLanguageCharacterDirection(_:)`](/documentation/CoreFoundation/CFLocaleGetLanguageCharacterDirection(_:))

Returns the character direction for the specified ISO language code.

[`CFLocaleGetLanguageLineDirection(_:)`](/documentation/CoreFoundation/CFLocaleGetLanguageLineDirection(_:))

Returns the line direction for the specified ISO language code.

### Getting the CFLocale Type ID

[`CFLocaleGetTypeID()`](/documentation/CoreFoundation/CFLocaleGetTypeID())

Returns the type identifier for the CFLocale opaque type.

### Constants

[`CFLocaleLanguageDirection`](/documentation/CoreFoundation/CFLocaleLanguageDirection)

These constants describe the text direction for a language. They are returned by the functions [`CFLocaleGetLanguageCharacterDirection(_:)`](/documentation/CoreFoundation/CFLocaleGetLanguageCharacterDirection(_:)) and [`CFLocaleGetLanguageLineDirection(_:)`](/documentation/CoreFoundation/CFLocaleGetLanguageLineDirection(_:)).

[Locale Property Keys](/documentation/CoreFoundation/locale-property-keys)

Predefined locale keys used to get property values.

[Locale Calendar Identifiers](/documentation/CoreFoundation/locale-calendar-identifiers)

Predefined locale keys used to get calendar values—values for `kCFLocaleCalendarIdentifier`.

[Locale Change Notification](/documentation/CoreFoundation/locale-change-notification)

Identifier for notification sent if the current locale changes.

## See Also

  [Internationalization and Localization Guide](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/Introduction/Introduction.html#//apple_ref/doc/uid/10000171i)



---

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)