Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

IOS 12.0.1 system.getPreference returns wrong value for ("locale", "language")
Started by pucman68 Oct 19 2018 12:53 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

pucman68

[GLOBAL: userInfoPane.html]
pucman68
  • Enthusiast

  • 46 posts
  • Corona SDK

Hi,

 

i just noticed that

system.getPreference("locale", "language")

 

returns a different language then

 

system.getPreference("ui", "language")

on a German/Austrian iPad

 

It seems that system.getPreference("locale", "language") always returns 'en' and not 'de' in this case.

 

Can anyone confirm this please and check if this is a bug of corona or an ios bug.

Running Corona on version 2018.3326

 

Andreas

 

 

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,860 posts
  • Corona Staff

Can you try the HelloWorldLocalized sample that's included in the SampleCode that ships with Corona?



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,860 posts
  • Corona Staff

FWIW, I just tried HelloWorldLocalized on my iPhone X running iOS 12.0.1, built with a version of Corona that supports the iOS 12 SDK and it worked as expected.

 

Rob



[TOPIC: post.html]
#4

pucman68

[GLOBAL: userInfoPane.html]
pucman68
  • Enthusiast

  • 46 posts
  • Corona SDK

Ok, I figured it out.

 

You need to have the "CFBundleLocalizations" line in your plist section in your build.settings file

 

I added this line and my app is working fine now again.

Strange thatI did not need that on previos IOS versions.

 

You can simple verify that by just removing this line in the HelloWorldLocalized sample app and you will get the same result.

 

        plist =
        {
            UIStatusBarHidden = false,
            UILaunchStoryboardName = "LaunchScreen",
            ITSAppUsesNonExemptEncryption = false, -- This sample doesn't use custom encryption
            --CFBundleLocalizations = {"en", "fr", "pt", "zh", "de", "it", "ja", "es", "ru", "uk"},
        },

 

Thank you for your help with the sample App

Andreas



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,860 posts
  • Corona Staff

This is an iOS 12 change.

 

I suppose we should add a note in the documentation about it.

 

Rob




[topic_controls]
[/topic_controls]