Language is not a localized workaround when calling iOS components in titanium

Source: Internet
Author: User

In iOS apps developed with titanium, while the system components are being called, the interface of those components is still in English, although the phone has been set to the Chinese language. For example, call the album component in iphone, whose interface is:

650) this.width=650; "title=" screenshot 2013-12-18 pm 2.26.28 "border=" 0 "alt=" screenshot 2013-12-18 pm 2.26.28 "src="/http Images.cnitblog.com/blog/130623/201312/18145410-bfbf4ba5ded241ec9403dd610e99ff09.png "width=" 324 "height=" 484 " Style= "Border:0px;padding-top:0px;padding-left:0px;padding-right:0px;background-image:none;"/>

So how do you keep it consistent with the system language?

In native iOS development, just set Cfbundleallowmixedlocalizations to true in Info.plist, representing localized resources can be mixed, is to allow the library to use local language resources.

So what should we do in titanium?

In fact, it is also very simple, titanium provides a way to configure the Info.plist, in the Tiapp.xml configuration on the line. Documents can be viewed: http://docs.appcelerator.com/titanium/latest/#!/guide/tiapp.xml_and_timodule.xml_ Reference-section-29004921_tiapp.xmlandtimodule.xmlreference-plist

Simply add the iOS tag to the tiapp.xml and then add the plist sub-label underneath it

Like what:

650) this.width=650; "title=" QQ20131218144258 "border=" 0 "alt=" QQ20131218144258 "src=" http://images.cnitblog.com/ Blog/130623/201312/18145411-cb7c0160f0414be5bf957df23f6681eb.png "style=" border:0px; "/>

As for which key values are available, what do these key values mean, you can consult Apple's development documentation.

We need to use the Cfbundleallowmixedlocalizations key and set it to true:

650) this.width=650; "title=" QQ20131218144258 "border=" 0 "alt=" QQ20131218144258 "src=" http://images.cnitblog.com/ Blog/130623/201312/18145412-29b0be196307448ea2a55eddc901f314.png "width=" 433 "height=" 157 "style=" border:0px; Padding-top:0px;padding-left:0px;padding-right:0px;background-image:none; "/>

OK, recompile the run, and then call the album in the app, the interface becomes Chinese:

650) this.width=650; "title=" screenshot 2013-12-18 pm 2.50.12 "border=" 0 "alt=" screenshot 2013-12-18 pm 2.50.12 "src="/http Images.cnitblog.com/blog/130623/201312/18145413-77231d8339064cd0bc5cdb17331dc8c8.png "width=" 324 "height=" 484 " Style= "Border:0px;padding-top:0px;padding-left:0px;padding-right:0px;background-image:none;"/>


Language is not a localized workaround when calling iOS components in titanium

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.