I'm writing some apps that have multiple languages. I know I can set up the devices to have international keyboards.
What would be terrific is if there was a way to select the English keyboard for the english words and the specific foreign keyboard for each language that I use.
Does anyone know if this is possible, and how?
It's up to the user which keyboards they use at all times. If they have multiple languages enabled then they can switch between them freely without leaving the view, as an extra button is added for the purpose. You can't give a hint as to which language the user is likely to want.
Those properties you can adjust are given by the UITextInputTraits protocol, so that should give a full list of things you can specify. I believe they're all exposed on the relevant controls by Interface Builder and/or Xcode 4, so shouldn't be much of a surprise.
I'm sorry to disappoint you, but what you're asking is simply not possible.
Related
Compared to Android iPhone does not support many languages, even though the MAC seems to do so ( simply because I learned that the possibility of adding these languages in xCode is for MAC Apps and not for iOS).
Now I added the Localizable.strings file for languages that are not available in the language list of the iPhone settings for languages.
Is there a way using the standard approach like:
[onOffSC setTitle:NSLocalizedString(#"On","Off") forSegmentAtIndex:0];
if I just put a selection menu in my app ?
Otherwise I would have to add a special logic - lets say MYNSLocalizedString, checking first if the user wants to select a non supported language, getting this some other way (probably putting these translations into a NSDictionary) and otherwise calling the standard NSLocalizedString.
I guess I would have to put a language selection menu in the app anyways - but can the calls to NSLocalizedString be used or do I have to add a meta-method MYNSLocalizedString like mentioned?
Or is there any other good solution for this ?
Many thanks!
I think better would be to use the language which is set in Settings, instead of user selecting from menu. Refer to this tutorial might help you understand How Localization is done.
http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial
For localization of your iPhone app:
Use the approach described here...
http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial
What is the difference in using macros NSLocalizedString and AMLocalizedString?
NSLocalizedString is part of the localization solution by Apple. AMLocalizedString is a custom localization implementation by Aggressive Mediocrity.
I recommend sticking to NSLocalizedString unless you really know that you need more features and that they make sense. For example, I think that switching the language inside the app at runtime (which the AM solution can do) is a misfeature that is more likely to confuse the user. Imagine you'd have one app in French, another in German, the next in English. Where do you change that? With the usual Apple localization, the user knows how and where to change it: in the iPhone language settings. But then, maybe there is an important and valid use-case for in-app runtime language switching, in which case NSLocalizedString won't suffice.
I'd like to support multiple languages in one of my apps. I don't have a problem with the localization for the supported languages, but I'd also like to support Irish (Gaelic).
Is this a case of overriding NSLocalizedString, checking an app variable for the user's selected country, and calling localizedStringForKey, passing in the relevant strings file as the table?
Is there a better way? Are there significant issues with this approach?
Can someone point me in the right direction please?
Thanks
Jez
Select a file you would like to have an Irish version of...
If you go to the right-hand-side editor (xCode 4) and hit the page-looking tab...
Go down to "Localizations" and hit the + sign...
Keep going down to "Other"...
And find "Irish"...
It will create a second version of the file you had selected and you can change all of the NSStrings etc. to Irish.
I need to make an application in which the user can toggle between two languages on triggering a click event on a button.
The problem here is that I have seen examples in which, if we want to load our localized nib file, then we need to change the language from the settings options and we can get the proper nib file loaded according to language selected.
I want to do this within my application, meaning I don't want to go to the settings menu and change the language and then reload the application.
I just want the above effect within my application (that is, through a button click event the app should be able to toggle between two languages).
Is it possible, and does Apple allow it?
Nobody here can tell you whether Apple will allow it, but if your app is well designed and there's a good reason for this departure from the usual way of doing things, you've probably got a good shot.
There's nothing to prevent you from loading a nib file localized for a different region. I'd probably avoid trying to use Apple's automatic mechanism, though. Just name your nib files using some pattern and load the appropriate one.
If you want your life to easy, you will take advantage of the Localization built into the operating system. Otherwise, you will have write your own methods to load localized strings or nib files.
There is no reason for Apple to reject an app that shows localized text based on an in-app setting. I work to help developers localize apps and, although I don't suggest this approach, they have done it and I've never heard of a rejection from Apple.
What you won't be able to do is use Apple's built-in tools, which rely on the system settings to determine a user's language and push the text from a Localizable.strings file. But it honestly won't take you too long to implement a similar system yourself using functions akin to gettext.
You essentially need to implement the same basic logic as any localization system:
1) Surround your in-app texts in a function that will display the proper language based on the user's chosen settings
2) Export your source texts (probably English into file
3) Translate the English strings into each language in a separate file
The function you write can follow the lines of gettext, which has examples in many programming languages. If the settings is "French" grab the equivalent string from the French file. If the setting is English, just print the English.
You won't be able to use Apple's tools, but you CAN do it on your own and Apple won't really care as far as I know. However, if you choose to localize into an Apple-supported language, follow this app localization tutorial for iOS using the standard Localizable.strings method.
I need help from you, I need to display all the text, labels , strings and what ever text is showing to user in the iphone application with respective selected language in settings of iphone.
for example user selects German or French in settings of iPhone language, then my application should provide or view the details in that language.
I need sample code for localization, Is there any simple way to follow the standard steps to translate the code to different languages in iphone sdk.
please healp me, I hope that I can get efficient solution on this from you.
Thank you,
Madan Mohan.
See here: http://www.icanlocalize.com/site/tutorials/iphone-applications-localization-guide/
I think the previous link gives a pretty good idea of how to do I18N on the iPhone, but if you feel you need more info, you can try this article http://blog.federicomestrone.com/2010/05/18/internationalise-your-iphone-apps-with-xcode/ which is just slightly more code-orientated.
The point though is always the same - you have to separate code from text resources and load all your text (strings) with the NSLocalizedString macro, or a variant thereof.