Using Xcode’s New String Catalogs with Objective-C
Can I use a String Catalog with Objective-C?
The answer is yes! Using Xcode’s new String Catalog feature in Objective-C for app localization is straightforward. There is very little difference in setup compared to Swift. Here are the steps, which are very similar to our guide for Swift.
Step 1: Add your String Catalog
File -> New File and add a String Catalog. String Catalogs in Xcode make managing multiple localizations more efficient, especially for large Objective-C projects.
Step 2: Update your strings
Simply change all your normal strings from @"My localized string" to NSLocalizedString(@"My localized string"). Using NSLocalizedString
ensures your strings can be translated effectively and are placed in the appropriate language files.
Step 3: Build your app
Once you build your app, all your strings will populate inside your String Catalog. This process helps streamline translation management for your Objective-C project.
Conclusion
With just a few simple steps, you can fully integrate String Catalogs into your Objective-C project, making app localization seamless. If you’re working with Swift, check out our guide on using String Catalogs with Swift.
If you have any questions or need further help with localization, feel free to reach out.