Growing Up with Globalization Andrew Turgeon - IBM - Pittsburgh, PA - - PowerPoint PPT Presentation

growing up with globalization
SMART_READER_LITE
LIVE PREVIEW

Growing Up with Globalization Andrew Turgeon - IBM - Pittsburgh, PA - - PowerPoint PPT Presentation

Growing Up with Globalization Andrew Turgeon - IBM - Pittsburgh, PA apturgeo@us.ibm.com 1 In the Beginning 2 3 4 5 6 7 8 9 10 New Customer! Except they require the following: 8 languages other than English


slide-1
SLIDE 1

Growing Up with Globalization

Andrew Turgeon - IBM - Pittsburgh, PA apturgeo@us.ibm.com

1

slide-2
SLIDE 2

2

In the Beginning…

slide-3
SLIDE 3

3

slide-4
SLIDE 4

4

slide-5
SLIDE 5

5

slide-6
SLIDE 6

6

slide-7
SLIDE 7

7

slide-8
SLIDE 8

8

slide-9
SLIDE 9

9

slide-10
SLIDE 10

10

slide-11
SLIDE 11

New Customer!

Except they require the following:

  • 8 languages other than English
  • Culturally-accurate data formats
  • Timezone support for 12 unique locations
  • Bidirectional text capabilities

11

slide-12
SLIDE 12

Wish I would have prepared for that before I wrote all this code…

12

slide-13
SLIDE 13

Agenda

  • Statistics Overview
  • Globalization
  • Getting Started
  • Basic I18n - The Rails Way
  • Variables & Pluralization
  • Culture-Specific Data

Formats

  • Bidirectional

Languages

  • Testing
  • Takeaways

13

slide-14
SLIDE 14

Statistics Overview

Languages of the Internet (2015)

English 26% Chinese 21% Spanish 8% Arabic 5% Portuguese 4% Japanese 3% Russian 3% Malay 3% French 3% German 3% Other 22%

74% of Internet traffic in 2015 was from users who prefer or only speak languages other than English

14

http://www.internetworldstats.com/stats7.htm

slide-15
SLIDE 15

520%

0% 1,750% 3,500% 5,250% 7,000% Japanese German English French Other Spanish Malay Portuguese Chinese Russian Arabic

Growth of Internet Users By Language (2000-2015)

15

Statistics Overview

http://www.internetworldstats.com/stats7.htm

slide-16
SLIDE 16

Statistics Overview

Timezones of the Internet

*Currently 39 Unique Local Times in use

16

http://royal.pingdom.com/wp-content/uploads/2013/02/internet-users-time-zones-pingdom-5801.jpg

slide-17
SLIDE 17

I get it. What do I need to do?

17

slide-18
SLIDE 18

Globalization

(in a nutshell)

Internationalization (i18n) Localization (l10n)

Our Job

18

Step 1 Step 2

slide-19
SLIDE 19

Watson Explorer

Lots of… English…

19

slide-20
SLIDE 20

Getting Started

  • You can retrieve the locale from the user preferences (best)
  • Or you can try getting it from the accept language header (ok)
  • Using the pre-bundled I18n framework in Rails,

add the following to the controller:

*Make sure to use it in the html tag!

20

slide-21
SLIDE 21

Basic I18n - The Rails Way

Somewhere in a galaxy far far away…

../config/locales/en/activity_feed.yml

  • DON’T REUSE same text
  • Hierarchy with short keys

BAD

*Note: Use ellipsis character (…), not three dots (...)

21

../app/widgets/activity_feed/display.html.erb

slide-22
SLIDE 22

Variables & Pluralization

  • Use interpolated variables for dynamic data
  • More plural forms exist in other languages

Bad

22

slide-23
SLIDE 23

Culture-Specific Data Formats

  • Define all your formats in key-value lookups, including defaults
  • Follow similar structure for currency, numbers, and percentages

Bad

23

*Required hierarchy for I18n.l usage

slide-24
SLIDE 24

Timezones

  • Always store in UTC (ISO6801)
  • Always consume in currently configured timezone
  • Make sensible defaults, but user setting is preferred

Bad

Example: Time visualizations in Javascript

24

slide-25
SLIDE 25

Bidirectional Languages

Not all languages read the same direction!

  • Use Unicode
  • For both right-to-left AND left-to-right text at the same time, use

embedded tags to indicate text direction

HTML5

25

  • Serve mirrored CSS for absolute/relative positioning
slide-26
SLIDE 26

Testing

  • Static code analysis with i18n-tasks gem
  • Testing dynamic translations (with RSpec):
  • Transitioning from non-i18n to i18n, create a “foo” or longer

word language pack for testing (easy to spot non-foo)

26

slide-27
SLIDE 27

Takeaways

  • Treat language as an abstraction from the beginning (sooner the better)
  • Don’t try to be a hero when doing i18n
  • Getting started isn’t too bad when you use a framework that is:
  • Maintainable
  • Modifiable
  • Testable
  • Translatable
  • addresses main pitfalls discussed in this presentation

27

slide-28
SLIDE 28

Q&A

28

Andrew Turgeon - apturgeo@us.ibm.com

slide-29
SLIDE 29

Thanks!

29