Swift 4 Locale.current in Playground seems erroneous

In a Playground created in XCode 9.1 Beta, if I type

print(Locale.current)

I get

en_EN (current),

despite I have set the System preference to a different region.


If an open (in XCode 9) a Playground created in XCode 8, I get the correct current

fr_FR (current)

The same in an IOS App gives in XCode 9

fr_US (current)


It works OK in XCode 8


Is there a known problem in XCode 9.1 Beta for Locale ?

Answered by DTS Engineer in 266895022

What type of playground are you creating? I would expect macOS playgrounds to pick up their locale from the system. iOS playgrounds, on the other hand, are trickier because they rely on some underlying simulator.

Filed bug report 34797262

Thanks. But please update your bug report to be more specific about the steps you took to reproduce this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Filed bug report 34797262

Accepted Answer

What type of playground are you creating? I would expect macOS playgrounds to pick up their locale from the system. iOS playgrounds, on the other hand, are trickier because they rely on some underlying simulator.

Filed bug report 34797262

Thanks. But please update your bug report to be more specific about the steps you took to reproduce this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Yes, that's an IOS playground.


I Updated the bug report and attached the playground.


Oh, and one more thing (I posted a specific on this 😕):

I don't know how to write the equivalent in Swift of objC : string path(path_in);

Can you help on this ? Thanks

Oh, and one more thing (I posted a specific on this ):

I don't know how to write the equivalent in Swift of objC : string path(path_in);

I’m not able to parse that second paragraph. I also didn’t see your separate thread about it. I recommend you create a separate thread, including more details, and then post the link to it here.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Sorry, the thread was in the getting started: h ttps://forums.developer.apple.com/thread/88677


Thanks

Swift 4 Locale.current in Playground seems erroneous
 
 
Q