The fact that 60 percent of all iPhone users worldwide are non-native English speakers is just one reason for supporting people from many countries and regions in your apps. Even if multi-language applications are not called for, localization features for single language apps will improve usability and acceptance from users across many cultures and geographic areas. Using an English-only iOS application from Nordstrom as an example, Shawn Larson shows you how with little effort you can add international support to your applications. He walks you through implementing code to take advantage of foundation classes and their associated matters to help you deal easily with international support issues like decimal, thousands separator, sorting, quotes, beginning and ending characters, date-time formats, calendars, name order, and more. Join Shawn, an IoS developer at Nordstrom, to see how easy it is to add international support that is much more than adding translating strings to text fields.
15. NAMES
• NSPersonNameComponents (iOS 9)
• givenName, middleName, familyName properties
• Try to avoid parsing at all cost
INT’L SUPPORT
UNICODE CHARACTERS
• Ever heard of emoji’s?
• Support for high value characters, generally Japanese and Chinese characters
16. UNICODE CHARACTERS
• Font support
• Depend on system provided fonts as much as possible
• Be aware of character substitution – Yen for a backslash
• Be cognizant of clipping diacritical marks with line height:
• Acute ‘ and grave ` accent characters
• Cedillas – hooks and tails: ç ć
• When working with labels, don’t set the width – allow it to be dynamic. Don’t set its content width
INT’L SUPPORT
MEASUREMENT SYSTEMS
• Be aware if the region use Metric System or Imperial Units
• Will you be displaying measurements, such as a Ruler, Shape dimensions, Page sizes
• Sizes of products - shoes
20. TEXT DIRECTION
• Depend on relative layout
• On iOS / Mac OS – Auto Layout & Constraints
• Avoid hard coded position values and absolute positioning
• Big assist for device rotation and orientation – Landscape / Portrait
• Positioning and resizing of controls
INT’L SUPPORT
SORTING
• Languages have different rules
• Swedish v. Other Languages:
• ä sorted after z; German sorts following the letter a
• Å, A, and B sorted as A, B, and Å. English sorts as A, Å, and B
• Makes you look smart with a section index
21. SORTING
• No general rule
• No sorting “object” available
• Sorting mechanism to support locale. iOS has localizedCaseInsensitiveCompare method
• General, you’re sorting based on Unicode value of character. Localization option adds another
component to respect those settings
• No singular win for the 1 language app but limited implementation cost for multilanguage support
benefit
INT’L SUPPORT
CLDR
• Unicode Common Locale Data Repository
• http://unicode.org - http://cldr.unicode.org
• Locale-specific patterns for formatting and parsing
• Dates, times, time zones
• How to represent numbers and currency values
• Grammar rules / pluralization
INT’L SUPPORT
22. CLDR, continued
• Language & script information
• Plural cases
• Gender of lists (pronouns)
• Rules for sorting & searching
• Writing direction
• Rules for segmenting text into graphemes, words, and sentences
• Country information
• Calendar preference and week conventions
• Telephone codes
INT’L SUPPORT
WHY SUPPORT PLURALS?
• Respect locale’s grammar rules
• Display text based on a value – Zero, One, Other
• Eliminates hard coded strings in code with IF statements
• Central place for strings and easier to modify and maintain.
23. CONFIGURING FOR PLURALS SUPPORT
• There are a number of hoops to jump through
• Much like localization support - .strings file with Keys and Values
• Also includes a Strings Dictionary file - .stringsdict
• .stringsdict holds entries Zero, One, Other and their results: Items, 1 item, %lu items
PLURALS DISPLAY
• Custom entry for a value of Zero
• Custom entry for a value of One
• Any other value falls into the Other
category. Displays the entered value