Logo for tanaschita.com

How to use String Catalogs for pluralization in Swift

Learn how to handle plural forms correctly with String Catalogs.

19 Jan 2026 · 3 min read

String Catalogs provide a type-safe way to handle plural forms across languages. In this article, we look at how to define pluralized strings in String Catalogs and how to use them from Swift without manual formatting or conditional logic.

Let's jump in.

Sponsorship logo
Architecture & Design Patterns for iOS
This book is a practical guide to essential architectural principles and design patterns for iOS development. It covers strategies for building maintainable apps with Swift and SwiftUI, including dependency injection, navigation, common patterns, and modularization.
LEARN MORE

Defining pluralized strings in a String Catalog

To define a pluralized string, we start by creating a localization key as usual, for example:

applesSelection.title

To enable pluralization, we right-click the key-value pair in the String Catalog and choose “Vary by Plural”.

Xcode then automatically generates the required plural categories for the current language. What remains is adjusting the translations for the different plural cases. For example:

%lld apple // For one
%lld apples // For other

The format specifier (%lld) tells the localization system that this string expects a numeric value, which will later drive pluralization.

Which plural forms are shown depends on the language. Some languages only require one and other, while others define additional categories.

Using the pluralized string in Swift and SwiftUI

Once a plural variable is defined, Xcode generates a typed accessor for the localized string. We can use it as follows:

Text(.applesSelectionTitle(1))

Outside SwiftUI, we can use the same accessor:

let text = String(localized: .applesSelectionTitle(5))

In both cases, the value we pass determines which plural form is selected for the current locale. There is no string interpolation and no conditional logic in code, the localization system handles everything.

Sponsorship logo
Preparing for a technical iOS job interview
Preparing for a technical iOS Job Interview with over 300 questions & answers. Covering Swift & Objective-C, SwiftUI & UIKit, Combine, HTTP Networking, iOS File System, Core Data, Concurrency with async/await, Security, Automated Testing, Dependency Management, AI & Machine Learning and more.
LEARN MORE
Sponsorship logo
Architecture & Design Patterns for iOS
This book is a practical guide to essential architectural principles and design patterns for iOS development. It covers strategies for building maintainable apps with Swift and SwiftUI, including dependency injection, navigation, common patterns, and modularization.
LEARN MORE
Sponsorship logo
Become a sponsor of tanaschita.com
By publishing an article on different iOS topics every week, tanaschita.com is constantly growing in the developer community and may provide a great audience for you as a sponsor.
CLICK TO LEARN MORE

Newsletter

Image of a reading marmot
Subscribe

Like to support my work?

Say hi

Related tags

Articles with related topics

localization

swift

ios

Migrating to String Catalogs in iOS

Learn about migration strategies from Localizable.strings to .xcstrings.

23 Mar 2026 · 3 min read

Latest articles and tips

© 2026 tanaschita.com

Privacy policy

Impressum