---
title: CSLocalizedString
framework: corespotlight
role: symbol
role_heading: Class
path: corespotlight/cslocalizedstring
---

# CSLocalizedString

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

## Declaration

```swift
class CSLocalizedString
```

## Overview

Overview The CSLocalizedString class helps you localize text in searchable items. You can use a CSLocalizedString object in place of an 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: 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

- [init(localizedStrings:)](corespotlight/cslocalizedstring/init(localizedstrings:).md)

### Getting a localized string

- [localizedString()](corespotlight/cslocalizedstring/localizedstring().md)

## Relationships

### Inherits From

- [NSString](foundation/nsstring.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByStringLiteral](swift/expressiblebystringliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSItemProviderReading](foundation/nsitemproviderreading.md)
- [NSItemProviderWriting](foundation/nsitemproviderwriting.md)
- [NSMutableCopying](foundation/nsmutablecopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Searchable items

- [CSSearchableItem](corespotlight/cssearchableitem.md)
- [CSSearchableItemAttributeSet](corespotlight/cssearchableitemattributeset.md)
- [CSCustomAttributeKey](corespotlight/cscustomattributekey.md)
- [CSPerson](corespotlight/csperson.md)
