Post

Replies

Boosts

Views

Activity

XCode 15 Localized strings with prefix operator function issue.
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.
2
0
897
Nov ’23
XCode 15 Localized strings with prefix operator function issue.
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.
Replies
2
Boosts
0
Views
897
Activity
Nov ’23