Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Internationalization of apps

Internationalization of apps

A short talk held at D·Labs about supporting internationalization in applications.

Dal Rupnik

July 01, 2015
Tweet

More Decks by Dal Rupnik

Other Decks in Technology

Transcript

  1.  Do we really think that most people will understand

    our applications in plain English? Should we maybe care for third world markets? WHY?
  2. INTERNATIONALIZING OUR APPLICATIONS  3 NORTH AM. 0.5 billion English,

    Spanish, French, Danish, … SOUTH AM. 0.4 billion Spanish, Portugese, Dutch, English, … AFRICA 1.1 billion Afrikaans, Arabic, Swahili, Malagasy, Tsonga, … ASIA 4.2 billion Chinese, Hindi, Javanese, Vietnamese, … EUROPE 0.7 billion English, German, Italian, French, Spanish, … World Population
  3. INTERNATIONALIZING OUR APPLICATIONS  4 INTERNATIONALIZATION When we are developing

    applications, we must keep in mind that internationalization is not easy. It might cost us a lot of time and resources, if by any case we need to go fixing things in entire application later. 
  4. INTERNATIONALIZING OUR APPLICATIONS  5 Language Which language is user

    speaking? Which language does he view content in? In which language does he want to see content? Most expensive to get it right. Locale Language preferences, region settings, calendar type, default currency. Cannot use for: physical location, identifying language. Region Settings Specific date, time, energy, mass, distance, currency formatting settings. On mobile, many things supported out-of-the-box. A couple of terms
  5. INTERNATIONALIZING OUR APPLICATIONS  6 There are many problems for

    international apps. But usually, when outputting text, we can sort these into 4 larger groups. NAMES TIME OTHER UNITS Localization
  6. DATE & TIME } Lets take a look at date

    and time formats. They can be different not only per language, but even per region!
  7. INTERNATIONALIZING OUR APPLICATIONS  8 The usual “hh:mm a”, but

    is that okay? Lets look at few examples of regular time formats. Most common time formatters are usually wrong. Formatting time 17:26 অপরাh ৫:২৬ 午後5:26 5:26 PM م٥:٢٦ 下午5:26 17.26
  8.  In U.S. English time is written differently from U.K.:

    5:26 AM vs 5:26 am. Notice the lowercase letters. 5:26 AM
  9. INTERNATIONALIZING OUR APPLICATIONS  10 Formatting time 5:26 PM -

    5:26 下午 ✘  Something like “hh:mm A”, right? For Chinese this just does not work!
  10. INTERNATIONALIZING OUR APPLICATIONS  11 Formatting time 5:26 PM -

    下午5:26 ✓ Lets fix this “Ahh:mm”. Are there any easier ways, but if statements?
  11. INTERNATIONALIZING OUR APPLICATIONS  13 Slovenski pravopis - člen 255.

    “Neskladenjska raba pike: Med deli številk, da ločijo enote različnih stopenj (npr. ure od minut, tolarje od stotinov, včasih tudi tisočice od nižjih enot) ali kot znamenje množenja.” Does it seem weird?
  12. NO!

  13. INTERNATIONALIZING OUR APPLICATIONS  18 June 3rd - 六⽉月 3rd

    ✘  Formatting dates Translated back from Chinese this means: Six 3rd month
  14. INTERNATIONALIZING OUR APPLICATIONS  20 Formatting dates 2014年6⽉月3⽇日 ✓ Now

    lets try the other way around. In Chinese: then becomes in U.S. English: 2014June3 ✘
  15. INTERNATIONALIZING OUR APPLICATIONS  So, what can we do? 22

    Locale Date Time English (U.S.) Jun 3, 2014 10:14 AM English (U.K.) Jun 3, 2014 10:14 am French (France) juin 3, 2014 10:14 AM Chinese (China) 6⽉月 3, 2014 10:14 上午 Do not use hardcoded format strings (“MMM d, y h:mm a” - in this example).
  16. INTERNATIONALIZING OUR APPLICATIONS  So, what can we do? 23

    Locale Date Time English (U.S.) Jun 3, 2014 10:14 AM English (U.K.) 3 Jun 2014 10:14 French (France) 3 juin 2014 10:14 Chinese (China) 2014年6⽉月3⽇日 上午10:14 Use correct date or time style formatters that output correct format based on configured locale.
  17. DURATION  What if we want to display a specific

    time interval? The problem becomes even more complex!
  18. INTERNATIONALIZING OUR APPLICATIONS  Duration, wait, what? 25 U.S. English

    French Chinese One hour, fifty minutes Une heure et cinquante minutes ⼀一⼩小时五⼗十分钟 1 hour, 50 minutes 1 heure et 50 minutes 1⼩小时50分钟 1:50 1:50 1:50 About 2 hours Environ 2 heures 约2⼩小时 In certain cases, we must display time as a duration, not explicit date and time.
  19. INTERNATIONALIZING OUR APPLICATIONS  Duration, wait, what? 26 U.S. English

    French Chinese June 2 - 6, 2014 2-6 juin 2014 2014年6⽉月2⽇日⾄至6⽇日 9:00 AM - 4:30 PM 9:00 - 16:30 上午9:00 - 下午4:30 June 2, 9:00 AM - June 6, 4:30 PM 2 juin 9:00 - 6 juin 16:30 6⽉月2⽇日 上午9:00 - 6⽉月6⽇日 下午4:30 June 3, 9:00 - 10:00 AM 3 juin 9:00 - 10:00 6⽉月3⽇日 上午9:00⾄至10:00
  20. NAMES h I bet nobody of you ever thought about

    formatting names. We just assume everyone has first and last name.
  21. INTERNATIONALIZING OUR APPLICATIONS  28 Formatting names print (first_name +

    " " + last_name) ✓ This is the code we usually use to print someones name: Which is fine for English: Barack Obama ✓
  22. INTERNATIONALIZING OUR APPLICATIONS  29 Formatting names 黛⽟玉林 ✓ Because

    in Chinese, there are no spaces… However, does not work for Chinese: 黛⽟玉 林 ✘
  23. UNITS g Many applications are working with at least 1

    kind of unit. It can be either currency, energy, length, mass, or something else.
  24. INTERNATIONALIZING OUR APPLICATIONS  Energy, length, mass 31 U.S. English

    French Chinese 234 Cal 980 kJ 980 千焦 26.2 miles 42,2 kilomètres 42.2公⾥里 128 lb 58 kg 58千克 74°F 23°C 23°C Various quantities are displayed differently in different regions.
  25. INTERNATIONALIZING OUR APPLICATIONS  Currency 32 English French Chinese Chinese

    Yuan yuan renminbi chinois ⼈人民币 Pound Sterling livre sterling 英镑 Japanese Yen Yen japonais ⽇日元 Formatting currency needs a special attention, as it depends on both language and locale!
  26. WHAT ELSE? u Sometimes we miss some things when localizing,

    we are not even aware that they are different in another culture.
  27. INTERNATIONALIZING OUR APPLICATIONS  35 k Right-to-left Text  Lunar,

    Buddhist Calendar  Different Keyboards Languages such as Arabic are written right-to-left. Need to understand the context of this, so all labels are correctly placed on canvas. There are many types of calendar available, not everyone may use the Gregorian calendar. Must ensure all calendars are supported. On mobile devices, languages and locales can have different on-screen keyboards, especially with glyph languages such as Japanese.  Does not end here…
  28. INTERNATIONALIZING OUR APPLICATIONS  Region Locale 37 Internationalization must be

    thought of in the beginning. 1 2 Formatting properly represents a hard problem for developers. 3 Careful with dates, times, units, names and text alignment. 4 Why can’t we all just speak the same language? :( Formatting Language v   k Summary