NSDoubleLocalizedStrings launch argument doesn't work for Swift projects

Originator:iyuna9119
Number:rdar://32441829 Date Originated:May 27 2017, 12:51 PM
Status:Open Resolved:
Product:XCode Product Version:8.3
Classification:Bug Reproducible:Always
 
Summary:
NSDoubleLocalizedStrings launch argument doesn't display localized strings twice as it supposed to be when working with Swift projects while it works ok with Objective-C projects.

Steps to Reproduce:
1) Create a Swift single-view project with one label on the view. Connect the outlet.
2) Set the label text as some localized string.
3) Specify NSDoubleLocalizedStrings launch argument to be true during run (by adding `-NSDoubleLocalizedStrings YES` to arguments passed on launch in arguments or by selecting `Double Length Pseudolanguage` for Application Language in options).
4) Run the app and observe the result. 

The view controller's code:
class ViewController: UIViewController {
    @IBOutlet var label: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        label.text = NSLocalizedString("Some text", comment: "")
    }
}

Expected Results:
Localized string should be displayed twice.

Observed Results:
Localized string is displayed only once.

Version:
macOS Sierra Version 10.12.5  XCode Version 8.3 (8E162) Simulator iPhone SE iOS 10.3 (14E269)

Notes:
This bug probably occurs because Swift does not support macros and `NSLocalizedString` is actually a macro.

Configuration:
This does not happen for the same Objective-C project.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!