1 / 16

How to do Localization Inside your iOS App Irrespective of the Phone Language

We received a new requirement from the same client whose project we had just completed. The mail read, “I want our application should change its language from inside application regardless of the phone language”.

paulcook159
Download Presentation

How to do Localization Inside your iOS App Irrespective of the Phone Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to do Localization Inside your iOS App Irrespective of the Phone Language

  2. Recently, while we were rejoicing the completion of an iOS app developmentproject with my team, an email intruded onto my screen. We received a new requirement from the same client whose project we had just completed. The mail read, “I want our application should change its language from inside application regardless of the phone language”. Did you guys ever come across this issue? Well, you might have! Hence, I thought of writing this blog to share my experience of how I resolved this issue.

  3. In this post I would like to cover the following points: • What is app localization? • How localization works in iOS? • Why iOS app localization should be your priority? • How to do localization inside your iOS app? • Why localization matters?

  4. What is app localization? App localization means adaptation of your application to meet the language, cultural and other requirements of your target market (a locale), as per W3C, the main international standard for World Wide Web. Localization is often written as l10n, where 10 is the number of letters between l and n.

  5. How localization works in iOS? Once you launch an iOS app, the operating system makes an effort to match up or collate your preferred device language(s) with the language(s) supported by your app. Your app has a default language. For instance, English and French are the languages supported by your app and in this case, the user sets English as the app’s default language. So now when the users’ phone language is set to French then your app will display French content.

  6. However, when the user changes phone language to Italian then your app will load the default app language which in this case is English. This is because your app only supports English and French and it doesn’t have Italian localization. So, in this case, your app will always display English content when the phone language is set to any language other than French.

  7. Why should iOS app localization be your priority? Over the years, the iPhone sales worldwide have seen tremendous growth. Let the numbers speak for itself, see image below (courtesy: Statista). In the above graph you can see Apple iPhone sales worldwide right from the third quarter of 2007 to the most recent financial quarter. Apple sold 216.76 million iPhones in the 2017 fiscal year and 52.22 millionin the second quarter of 2018.

  8. From 8 billion U.S. dollars in 2004, Apple’s revenue increased to more than 229 billion U.S. dollars in 2017 despite fierce competition in the smartphone market worldwide. And the credit partly goes to the iPhone success in almost all the countries. Now, you can expect your next customer to come from India, China, Mexico, Thailand or anywhere! Therefore, getting your iOS app localization strategy right could translate into more app downloads.

  9. How to do localization inside your iOS app? When it comes to changing the language as per the phone then we generally take our phone language code and load the “lproj” file accordingly. But in this case it has to be dynamic, so I have created an extension of “String”.

  10. Take a look at the code below: extensionString { publicvar localized: String { ifletbundleName:String = UserDefaults.standard.value(forKey: “USER_LANG”) as? String { let path = Bundle.main.path(forResource: bundleName, ofType: “lproj”) let bundle = Bundle.init(path: path!) returnNSLocalizedString(self, tableName: nil, bundle: bundle!, value: “”, comment: “”) } else { returnNSLocalizedString(self, tableName: nil, bundle: bundle!, value: “”, comment: “”) }

  11. Now, when the user would change the language from app, their selection will be saved in UserDefaults with key “USER_LANG”. As soon as you call localized function, then from UserDefault key like “EN” or say “NL” will load along with proper bundle. In other words, if already “EN” language is selected and you change to “NL” then it will get stored in UserDefaults. And whenever localized function of String gets called it will load appropriate language translation, as shown below:

  12. Now, when the user would change the language from app, their selection will be saved in UserDefaults with key “USER_LANG”. As soon as you call localized function, then from UserDefault key like “EN” or say “NL” will load along with proper bundle. In other words, if already “EN” language is selected and you change to “NL” then it will get stored in UserDefaults. And whenever localized function of String gets called it will load appropriate language translation, as shown below:

  13. Why localization matters? I have mentioned here three key reasons why you must prioritize iOS app localization: 1. Reach out to the global market: With proper research and right localization strategy your app can dissolve geographical and cultural barriers and reach out to a wider audience. An extended customer base is always beneficial for your business. 2. Better engagement levels and UX: Customers would love to see the content fully adapted in their native language. Users getting real value out of your app in turn would boost engagement levels. The more engaged your app users are, the better it is for your business.

  14. 3. Create differentiation:When you upload your app to the steeply competitive app store then localization can help you differentiate from other similar ones and reach out to your target audience faster. Thus, app localization can lead to boost in revenue and help you get better ROI.

  15. Summing up With iPhone sales gaining momentum in different countries over the past decade, localization could be a major factor influencing users’ download decisions. You can also take a look at the third party library shown below: https://github.com/PiXeL16/IBLocalizable Have you ever come across this issue of doing localization inside your iOS app? Did you find this post useful? I would love to hear from you; please share your thoughts by leaving your comments below.

  16. Interested To Know More About? Outsource iOS App Development Mobile App Development iOS Application Development

More Related