Introduction

Welcome! Accueil! Przywitać! Image

Welcome to your first taste of localization: the word “welcome” translated into the four languages English, French, Polish, and Japanese. But this book is about more than localization and translating strings. This book covers internationalization. What is internationalization, and how does that differ from localization? Although these terms do tend to become interchangeable, their applications are not equivocal.

Internationalization is the process of preparing your app to be localized. It encompasses supporting the cultural information of a given region and locale. It is preparing your code to support the character set, calendars, number format, sorting, and text direction of that locale, just to name a few. You often see the term “internationalization” abbreviated with the numeronym “i18n.”

Localization is the process of translating text and assets to support a specified region’s language. It’s often abbreviated “l10n.”

So that’s the “what”; what about the “why?” Why a book about internationalization, and how is it worth your investment of time?

Image iOS internationalization information and resources are scattered among fantastic blog posts, tutorials, and book chapters. This book’s goal is to be a central repository for all things internationalized.

Image You can generate goodwill with your customers. Customers appreciate the fit and finish effort to make it easy for them to understand your application by having it support their cultural norms.

Image The numbers point to supporting more than a single market: 60% of iPhone users worldwide are not native English speaking, and 50% of the countries within the top 10 for downloads and revenue in the iOS App Store are non-English-speaking countries from Europe and East Asia. App revenue in Asia increased by over 150% year-over-year (2012 to 2013), while North America’s revenue grew by just over 45%. (Source: Distimo 2014)

Image The extra resources needed to support internationalization are not out of budget. Most Objective-C classes include a specific “locale” property or method. By including that call, you’ve added incredible flexibility and support to your application with minimum developer effort. Localization of your application can be an initial resource hit, but after it is established, it becomes a straightforward process of supplying string tables for supported languages.

These are compelling arguments for budgeting time and resources to internationalizing your application!

Reader Expectations

This book does have a few expectations of you, with the biggest being an understanding of Objective-C. A basic list of what is expected follows:

Image Objective-C—This is the programming language for iOS. This book assumes that you have a strong working knowledge of Object-C because it pulls from existing classes and references methods and properties from each. It is also assumed that you have experience working with view controllers, XIBs, and Storyboards.

Image Xcode 5.x and later—Much of the coding throughout the book references Xcode, its layout, and its tools and options, including Interface Builder. It is also assumed that you have a working knowledge of and familiarity with the iOS Simulator.

Image iOS 7 and later—You will not need an iOS device, be it an iPhone or an iPad, but you do need to have experience using the device. Many of the instructions throughout the book are detailed, and a working knowledge of the System would be to your benefit.

Image Apple Developer account—This is not a requirement but it’s great to have access to the Apple Developer resources and WWDC materials and videos. This also makes it easier to follow Chapter 7, “Submitting Your App,” and its discussion on localizing your app summary in the App Store.

How This Book Is Organized

Here’s a summary for each of the book’s chapters:

Image Chapter 1, “International Settings—This chapter covers the supported languages, regions, and calendars available in iOS 7. We’ll talk about what differentiates a “language” setting from a “region” or “locale” setting. This chapter goes step-by-step in how to change these settings. It gives details on how the settings are presented—in the native language for the most part—as well as background information on each of the settings. The chapter also includes detailed lists of the supported formats—date, time, currency, quotation marks, separators—for each language and region.

Image Chapter 2, “Characters and Encoding—This chapter covers character sets, understanding and working with them. We’ll talk about their storage and display and how encoding can potentially affect both of those aspects. Unicode is covered, as well as how it simplifies working with character sets. We’ll look at locale-specific character sets and their interaction with characters and ligatures. We’ll go into character details on retrieving their Unicode code points and the tools that make that possible. A discussion on fonts wraps up the chapter.

Image Chapter 3, “Coding for Locale—This chapter includes lots of code. There are many samples to cover specific locale classes, NSLocale, and the locale-specific arguments we can harness for our good from the NSNumberFormatter, Address Book Framework, NSDateFormatter, NSTimeZone, NSDateComponents, and NSString classes. We’ll demonstrate how they all respect the current locale settings for the System and verify that their return values are correct for the given locale.

Image Chapter 4, “Prepping Your App for Localization—We’ll take our lessons learned in Chapter 3 and apply them to a sample internationalization app, the I18nExerciser. This app will carry us through to Chapter 6. We’ll build an app that will display locale-specific information including date styles, character sets, measurement system, number formatting, sorting, current calendar, contact names, and many more items. No localization happens with this chapter. This is the prep, setting up our app to automatically handle localization.

Image Chapter 5, “Localizing Your App—We’ll take our sample app and walk through the localization process. We’ll cover the power of base localization, generate “dot-strings” files, and work with the key-value pairs in the “dot-strings” files. We’ll also cover localizing images and localizing the app name, and we’ll discuss working with translation services.

Image Chapter 6, “Adjusting the UI—The majority of this chapter covers Auto Layout and constraints. When the localized strings are applied, they can be longer than our default development language. We’ll cover how to prevent clipped strings with appropriate constraint settings. This chapter also covers how to support right-to-left languages via the proper constraint settings. We’ll also discuss implications of the height of the keyboard for different languages. We’ll cover available tools such as pseudo localization, double strings, and launch switches. We’ll wrap up with UI localization, images, colors, and string length.

Image Chapter 7, “Submitting Your App—This chapter hits on the App Store and iTunes Connect. It includes details on supported territories and pricing tiers. The chapter completes “language mapping” between the number of supported iOS 7 languages, to the languages spoken in iTunes Connect territories, to the languages listed in iTunes Connect on the app summary page. The chapter covers the how-tos for changing territories, as well as what fields to localize on the app summary page: name, description, keywords, URLs, screenshots, and EULAs. The chapter closes by covering Apple’s promotional materials and discussing how to see your app in regional App Stores.

Image Appendix A, Case Study: Boom Beach—This appendix focuses on the numbers. Stats for a specific app’s download and sales increase after a Japanese localized version is provided.

Image Appendix B, Web Resources—This is a listing of web resources related to internationalization and localization.

Getting the Sample Code

Chapters 4, 5, and 6 are written so that you can complete the sample project from scratch. Because they are set up with minimum instruction, I made the completed projects available on my GitHub account: https://github.com/ShawnLa-i18n. Each chapter has its own associated project so that you can follow the project progress, see the mistakes, and see how they’re fixed.

Contacting the Author

Feel free to contact me via e-mail at [email protected] if you have any comments or questions about this book, or contact me at the GitHub repository.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset