Localizable.strings alway return English

Xcode7 beta 5 on OS X EI Captian beta(15A244d)

My App support languarge : English,Chinese(Simplified),Chinese(Traditional).

I had create files: Localizable.strings(Base),Localizable.strings(English),Localizable.strings(Chinese(simplified)),Localizable.strings(Chinese(Traditional)).

Now, the problom is:

Run on My iphone6 , ios9.0(13A4325c), App always return English. But Run on Simulator (device: iphone6\iphone5\iphone6p) alway perfect. Why???



I use this func to display current languarge. Below:


func currentLanguare() -> NSString {

let currLanguages = NSBundle.mainBundle().preferredLocalizations[0]

return currLanguages

}


ViewController.swift:

Override func viewDidLoad() {

let localizationlanguage:NSString = currentLanguare()

print("Current: \(localizationlanguage)")

//...

}


If App run on iphone, debug windows display " Current: zh_CN" , run in Simulator will display "Current: zh-Hans". Why ???

Why Simulator is always Perfect, But run in iphone alway fail ?


Please help. I've been sad for several days.

Accepted Reply

These days, the issue of language switching haunt me. Now, I had found a solution to my problem: REMOVE "Localzable.strings(Base)"!



1. Click on the left of the "Localizable.strings", then click the right toolbar (Hide or show utilities), find "Localization", Remove the hook of "Base".

2. Xcode7 will xcode will pop up a alert, then Remove it.


There are three documents under the “Localizable.strings" directorly. Localizable.strings(English),Localizable.strings(Chinese(simplified)),Localizable.strings(Chinese(Traditional)).

My iphone6 and simulator always perfect during switching Language.

Replies

These days, the issue of language switching haunt me. Now, I had found a solution to my problem: REMOVE "Localzable.strings(Base)"!



1. Click on the left of the "Localizable.strings", then click the right toolbar (Hide or show utilities), find "Localization", Remove the hook of "Base".

2. Xcode7 will xcode will pop up a alert, then Remove it.


There are three documents under the “Localizable.strings" directorly. Localizable.strings(English),Localizable.strings(Chinese(simplified)),Localizable.strings(Chinese(Traditional)).

My iphone6 and simulator always perfect during switching Language.