Contents

CSLocalizedString

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

Declaration

class CSLocalizedString

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

Getting a localized string

See Also

Searchable items