Xcode 15 string catalogs with UIKit warnings

490 Views Asked by At

I'm starting a new project and trying to use the new String Catalogs instead of SwiftGen. I created a Localizable.xcstrings file and added my only (for now) language.

In a UIViewController I added a label and set the text like so (I plan on supporting iOS 14, so 'String(localized: )' is not an option):

label.text = NSLocalizedString("login.cool", comment: "login.cool")

After I build the project, an entry appears in the .xcstrings file with the key "login.cool" -> I add the translation -> build and run -> the label correctly displays the text, but I get a warning for each entry in the xcstrings file:

String ‘login.cool‘ was ignored because it is not managed manually (nil)

I don't understand the warning at all. Also is it true that all the string keys should be manually typed? E.g. I won't get smth like SwiftGen's let str = Strings.login.cool, instead I'll always need to type out the key as a string "login.cool"?

0

There are 0 best solutions below