iPhone support Multiple Languages - iphone

In my project, I need to support the Korean language. How is it possible - can anyone explain briefly with example, whether it is possible or not?

It's certainly possible.
You just tell Xcode to add a Korean localization to any of your application's localizable resources that need to change for that language. (Localizable resources include strings files, xib files, and potentially any images containing text.) Xcode will create a copy of your existing English resource, which you can modify and replace with a Korean-language equivalent.
Then when your application is run on a device with Korean set as its preferred language, iOS will automatically use the Korean resources intead of the English ones to present the application's user interface. If you have used good localization code practices (such as using NSLocalizedString to reference strings you present in the user interface) you shouldn't have to change any of your code to support different languages.

Check this guide on how to localize your apps for iPhone: http://www.icanlocalize.com/site/tutorials/iphone-applications-localization-guide/

Related

Is it possible to have 2 different application icons depending on the language? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Localization of icon and default screen in iPhone
As my question already says, I want to have 2 different application icons.
If for example english is the native language on the device I want it not only to have a different app name but also a different icon.
So is that actually possible?
According to apple documentation, you can do it.
An iOS application should be internationalized and have a
language.lproj folder for each language it supports. In addition to
providing localized versions of your application’s custom resources,
you can also localize your application icons and launch images by
placing files with the same name in your language-specific project
directories. Even if you provide localized versions, however, you
should always include a default version of these files at the
top-level of your application bundle. The default version is used in
situations where a specific localization is not available. For more
information about localized resources, see “Localized Resources in
Bundles.”
This info was extracted from here:
https://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
You can do it, if you want too... just click on your icon file (consider Icon.png) now simply click on the ‘+’ in that ‘Localization’ pane on the right.
Add languanges that you want to provide support. Consider you have English And Spanish language support, add those two languages. It will create ‘en.lproj’ and ‘es.lproj’.
Now just see those directory, you can see both directories have their own copy of Icon.png. So just replace that image and make sure new file has same name as the replaced one.
Now Run it. And check by changing language in Setting>International>Language
Basic thing is based on language it will check if localization is available for that particular resource, if it exists it will be used.
No, you can't have localized app icons
Sorry, I was very wrong, it is possible. I was quite sure but my information obviously was very outdated :).

internationalization of an iPhone Application

I am new to iPhone App development (I am using XCode 4.2) and I was wondering if there is a way to translate all the strings , caption etc ... internally without having to translate them one by one .
an idea I have in mind is to use NSUserDefaults to save the language as a global variable and translate everything accordingly
another option is to make a look up table (is it even possible in Objective-C ?)
Thanks
You can use NSLocalizedString(#"<#key#>", #"<#comment#>") and one file (named Localizable.strings( per language. If you use the above function you can use the App Linguan (available on the Mac App Store) to generate the Localizable.strings files.
There is also a command line tool called genstrings that will create the file for you, but believe me that Linguan app will pay for itself in minutes.
You should always add a comment to allow a better translation and to provide context about the key.
You can read a step-by-step tutorial of the process here:
iPhone Localization Tutorial
Here's a high-level overview of the basics (the above tutorial has details):
1) Change all your coded strings to call: NSLocalizedString(#"My text", #"Context for the translator")
2) Export all your strings using the genstrings Terminal command.
3) This creates a text file called Localizable.strings with all your English (source) strings. It looks like this:
/* Context for the translator */
"My text" = "My text";
You send that file to the translators. They'll translate the right side like this: "My text" = "Mi texto";
4) You place each translated Localizable.strings file in its proper language folder: en.lproj, fr.lproj, es.lproj, etc.
When your app loads on the iPhone it will check the user's language settings. If the user has chosen French as the system language, the Localizable.strings inside your fr.lproj folder file will load. If there are any untranslated strings, it just defaults to English (or whatever your source language is) for those.
It's worth following the whole tutorial and note that the file/folder names have to be exact!
Look up the documentation for NSLocalizedString. And how to localize your .xib files (you make localized copies in English.lproj, de.lproj, fr.lproj, etc.).
All you will have to create are the files with the key-value pairs for each language you want to translate and name them accordingly i.e. _en, _fr and so on.
Then all you have to do is send a message to this method:
NSLocalizedString(#"myKey", nil)
And this will return the localized String, in whatever language the current iPhone configuration is.

iOS localization. Aim to localize strings in all languages, but images in only some languages

I'd like to localize my application with the following pattern:
Localize all strings (say English, French and German (don't mention the war!))
Localize some images in some languages (say just English and French)
I can localize the strings without issue. My problem is that when I add the German strings, the other resources that are localized into English and French attempt to find a German version. I don't want to provide a German version (trying to avoid too many superfluous images as they bulk up the size of the app).
Can anyone suggest a way of telling the application not to bother looking for a German version of the images.
My problem isn't adding languages, it's ignoring them under certain conditions. I don't want to include a German version of "a.png", but I do want to include a French version of "a.png". When the user's language is set to German, I'd like it to select the default language which is English.
Having had the same issue I want to follow up on this as the suggested resolution did not work exactly as quoted.
My setup is 3 localized languages, de, en, fr. The .lproj folders Xcode created are thus named
en.lproj
de.lproj
fr.lproj
I have a graphical button with "start" on it that needs localization from english to french but not to german (as it is the same word).
My "Localization native development region" was set to "English", which must have been the default (maybe a while back, the project has been a wip for quite a while).
The button did not show up on german devices. Switching to "EN" or any of the suggestions from Xcode ("United Kingdom", "United States of America") did not resolve the issue.
The solution was simpel. The string in the "Localization native development region" needs to exactly match the (native language).lproj string. So setting it to "en" it finally resolved the issue.
Hope this helps whoever stumbles upon this question.
iOS (and Mac OS) should always fall back to the app's default language. If you don't include the image.png in the de.lproj resources folder, the app should use the en.lproj/image.png file in its place.
Look for key: "Localization native development region" in the Target > Info pane of Xcode. Make sure that says EN.
I don't have that much experience but as far as I'm concerned, your program should just look for the german image, find nothing and then try to load the english image instead.

about iOS localization

In the following doc:
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html
it's mentioned that
In iOS, the bundle interfaces do not take dialect or script information
into account when looking for
localized resources; only the language
designator code is considered.
Therefore if your project includes
language-specific project directories
with both a language and region
designator, those directories are
ignored. The bundle interfaces in Mac
OS X do support region designators in
language-specific project
directories.
I don't quite understand this. Does it mean that the name of .lproj directory cannot contain any region code?
But at least I know that iOS accepts zh_TW.lproj, zh_CN.lproj. How about en_GB.lproj and en-GB_GB.lproj? Or it only knows en.lproj?
This simply means that iOS would support only two digit language codes (e.g. en.lproj, es.lproj etc.). Whereas Mac OS X will support the format Language_Region (e.g. en_GB, en_US etc.).
I think that information is outdated. They must not have updated the Mac development docs when the iOS changes were made.
When you're creating your Localizable.strings or Project.plist file, you will create one per language or language-dialect. Just create the ones you need.
If you're using Xcode 4, be sure to show the "Utilities" (View-->Utilities-->Show Utilities) when the Localizable.strings or Project.plist file is selected. It will have a Localization section that makes adding these easy.
UPDATE: As of iOS 8 you can now use any language or region in iOS.
Apophenia is correct. Although iOS has 30 languages that it will recognize as .lproj folders, it won't accept any regional codes, so telling it fr-CA won't get you French Canadian, but rather will simply use your French or English strings. The only exception to this rule is Chinese, which should be zh-Hans for Simplified Chinese and zh-Hant for Traditional Chinese.
You should always use the two-letter code for the language (en.lproj, fr.lproj, es.lproj, de.lproj, and so on).
There is a complete (and updated) list of the current supported languages and language codes for both iOS and iTunes here:
http://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html
Note that the iTunes App Store has a different list of supported languages, which makes the chart linked to above very handy!

Help Regarding Multi Language Translation in I Phone Application?

I want to create a multi language application...I want user to select language at Runtime..not from settings.
How can I create It????
I know how to Localize the application based on language settings from I phone.
But I want it at runtime.
Please help me out.....
Thanks in advance...
You'll have to build your custom solution. For example for a simple .plist file you could have multiple .plist with different languages and depending on the language you set through your app. load a different .plist file.
It is quite some work to do for all the files, xibs and strings. I think you should reconsider doing that, why would people choose to change the language of just your app?