I have currently migrated to String catalogs. I have a prefix operator function like below to set a localized string and its working fine.
prefix operator &&
prefix func &&(key: String) -> String {
NSLocalizedString(key, comment: "")
}
Usage:
let sampleText = &&"alpha.beta.gamma"
label.setText(sampleText)
But with XCode 15, strings from the code are not added automatically to the catalog file. But if I declare like below in the code, its working as expected.
let text = NSLocalizedString("Hello world", comment: "")
label.setText(sampleText)
Thought and insights will be much appreciated.