<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSLocalizedString",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSLocalizedString"
  },
  "title" : "CSLocalizedString"
}
-->

# CSLocalizedString

An object that displays localized text in search results related to your app.

```
class CSLocalizedString
```

## Overview

The `CSLocalizedString` class helps you localize text in searchable items. You can use a `CSLocalizedString` object in place of an <doc://com.apple.documentation/documentation/Foundation/NSString> object to display localized text in search results related to your app.

For example, you might use the following code to define a `CSLocalizedString` object for a searchable item you want to identify as “Song” in English:

```objc
CSSearchableItem *item = [CSSearchableItem new];
    item.uniqueIdentifier = @"song";
 
    CSSearchableItemAttributeSet *attributes = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(NSString *)kUTTypeItem];
    item.attributeSet = attributes;
 
    CSLocalizedString *displayName = [[CSLocalizedString alloc] initWithLocalizedStrings:@{@"en":@"Song", @"fr":@"Chanson"}];
    attributes.displayName = displayName.localizedString;
```

## Topics

### Specifying localized strings

[`-  initWithLocalizedStrings:`](/documentation/CoreSpotlight/CSLocalizedString/init(localizedStrings:))

Initializes a `CSLocalizedString` object with the specified dictionary of localized strings.

### Getting a localized string

[`-  localizedString`](/documentation/CoreSpotlight/CSLocalizedString/localizedString())

Returns the localized string for the current language.

## Relationships

### Conforms To

[`NSMutableCopying`](/documentation/Foundation/NSMutableCopying)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`ExpressibleByStringLiteral`](/documentation/Swift/ExpressibleByStringLiteral)

[`NSItemProviderReading`](/documentation/Foundation/NSItemProviderReading)

[`Hashable`](/documentation/Swift/Hashable)

[`ExpressibleByExtendedGraphemeClusterLiteral`](/documentation/Swift/ExpressibleByExtendedGraphemeClusterLiteral)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSItemProviderWriting`](/documentation/Foundation/NSItemProviderWriting)

[`ExpressibleByUnicodeScalarLiteral`](/documentation/Swift/ExpressibleByUnicodeScalarLiteral)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`NSString`](/documentation/Foundation/NSString)

---

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)