Software Archive
Read-only legacy content
17061 Discussions

Language of native controls IOS

Jonatan_B_
Beginner
689 Views

I have a created an app and I'm testing it on a IPad. The IPad has the system language set to Swedish. But in the app, labels for native controls display in English. For example, ff I long press on a input in the app I get "Paste". If I do the same thing in any other app i get the Swedish text "Klistra in" instead.

Why does it display in English? Shouldn't it always use the system language for native controls? Can I change this somewhere?

For Android Crosswalk it works. If the unit has Swedish as system language, the labels display correctly in Swedish.

0 Kudos
12 Replies
PaulF_IntelCorp
Employee
689 Views

Have you tried using the Cordova Globalization plugin? See this page for reference: https://github.com/apache/cordova-plugin-globalization and in the new XDK (2496) you can get the plugin via the core Cordova plugin list.

0 Kudos
Jonatan_B_
Beginner
689 Views

Paul F. (Intel) wrote:

Have you tried using the Cordova Globalization plugin? See this page for reference: https://github.com/apache/cordova-plugin-globalization and in the new XDK (2496) you can get the plugin via the core Cordova plugin list.

I actually did although I don't see why it should matter. And it didn't help. I don't understand why it just works on Android but it is wrong in IOS? Its for the basic input controls.

0 Kudos
PaulF_IntelCorp
Employee
689 Views

The behavior is depending on the target platform, the XDK does not dictate that behavior. You can think of it as being similar to the difference between writing a web app for Chrome vs. Firefox vs. IE vs. Safari, etc. See this blog for a little background.

0 Kudos
Jonatan_B_
Beginner
689 Views

Ok, but does anybody then know how I can set the language that is used for labels/controls etc in the webview for IOS?

I still think it should automaticly use the same language as IOS is set to but it doesn't. I tried adding the globalization plugin but it didn't fix the problem and I can't find that it has any method for setting the language, just getting values.

0 Kudos
PaulF_IntelCorp
Employee
689 Views

I would do a search on StackOverflow for something like "phonegap cordova ios language settings" -- the Intel XDK creates Cordova apps (as does PhoneGap) so the fixes you find for a Cordova/PhoneGap app should work with the XDK.

0 Kudos
Jonatan_B_
Beginner
689 Views

Ok, find this: http://stackoverflow.com/questions/26324669/how-to-localize-cordova-ios-projects

That I need to add 

<key>CFBundleLocalizations</key>
<array>
    <string>es</string>
</array>

To .plist file. How do I do that with IntelXDK? I found this: http://stackoverflow.com/questions/27153299/editing-ios-plist-file-in-windows-intel-xdk but is sems like it wasn't really supported?

0 Kudos
PaulF_IntelCorp
Employee
689 Views

That undocumented feature is probably still there, the intent is to support that sort of feature. Give it a try and see if it works. I'll also ask the build engineer to comment.

0 Kudos
Eric_H_Intel
Employee
689 Views

It is an undocumented feature for iOS builds.   It should work although it is currently unsupported.   Let me know if you run into any issues with using it.

 

0 Kudos
PaulF_IntelCorp
Employee
689 Views

p.s. Jonatan, please report back if it works and what you put into the additions.xml file to make it work so we can document for others. :)

0 Kudos
PaulF_IntelCorp
Employee
689 Views

I've made a feature request to see if we could get this added to the build settings.

0 Kudos
PaulF_IntelCorp
Employee
689 Views

Dario -- based on the original post dates here and in StackOverflow -- I suspect this is no longer working. It was an experimental thing being done in the build system and, I suspect, it probably only worked with the now retired CLI 4.1.2 build system. Our build system was substantially rebuilt with the CLI 5.x releases, and this experimental stuff likely disappeared with that rebuilding because it was never a released feature. The feature request is still outstanding.

0 Kudos
Jan_F_1
Beginner
689 Views

I can get it to work with this plugin: https://github.com/escapedcat/cordova-plugin-localization-ios

-Downloaded the repo, changed plugin.xml for my language codes and imported in XDK as local plugin.

0 Kudos
Reply