How to change all the strings in an iphone application with respective selected language in settings? - iphone

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.

Related

adding languages for localization to iPhone - is that possible?

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

Localize iPhone app to support Irish

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.

Localization issue in iphone

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.

iPhone Internationalization. What is the simplest workflow for me?

I am wising up and getting my internationalization act together. Right off the bat I am a bit swamped by all the docs Apple provides so I was wondering of someone could sketch a workflow for my situation.
Before I begin, I browsed some Apple example code and noticed this NIB file - MainWindow.xib - in the Resources folder:
alt text http://daturner.com/stackoverflow/nib.jpg
This clearly has something to do with internationalization/localization. Could someone please explain how this is created and where in the workflow it happens?
My app is fundamentally an imaging app with a few labels that I currently programmatically internationalize using NSLocalizedString(...). If I set all my labels programmatically and wrap all my strings with NSLocalizedString(...) can I completely ignore the NIB issues?
Thanks in advance,
Doug
To answer your last part of the question: Yes!
In my experience, it can be a pain to localize Nib's so if at all possible try to limit the localization effort to .strings files.

iphone how to localize only particular parts of app

i'm making a korean/english app, so naturally i would need both english and korean displayed on the same tableview cell at the same time. i've considered specifying an element in the plist to be a particular language... but how would i write in korean characters?
i have a dreadful feeling there will be much to custom code for this without apple's wonderful documentation. thanks for any guidance in advance.
Holy monkey. Turns out I thought it was way more difficult than it is, and I skipped even testing the most basic ways of doing it. All you have to do is basically copy and paste the foreign characters into the plist... That's it. Nothing else. Face in hand and lesson learnt.