Slide 1

Slide 1 text

Unicode Beyond Just Characters Localization with the CLDR

Slide 2

Slide 2 text

Unicode Beyond Just Characters Nova Patch @novapatch Shutterstock

Slide 3

Slide 3 text

Slide 4

Slide 4 text

Slide 5

Slide 5 text

Slide 6

Slide 6 text

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

ぷ Ꮨ ⇱ K ㋻

Slide 9

Slide 9 text

Ꙃ २ ௲

Slide 10

Slide 10 text

⇱ ⤳ ⪷ ௲ २ ൪ G K ж Ꙃ ﲵ Ꮨ 얜 ぷ ㋻ 森

Slide 11

Slide 11 text

→ g حض ← ﲵ ㋻ →ワ

Slide 12

Slide 12 text

→ g ﲵ ← حض ㋻ →ワ

Slide 13

Slide 13 text

→ g ﲵ ← حض ㋻ →ワ

Slide 14

Slide 14 text

Unicode CLDR

Slide 15

Slide 15 text

i18n vs. L10n

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

PyICU Python package

Slide 22

Slide 22 text

from icu import Locale locale = Locale('fr')

Slide 23

Slide 23 text

from icu import Locale locale = Locale('fr') Locale('en-US').getDisplayLanguage(locale)

Slide 24

Slide 24 text

from icu import Locale locale = Locale('fr') Locale('en-US').getDisplayLanguage(locale) anglais

Slide 25

Slide 25 text

from icu import Locale locale = Locale('fr') Locale('en-US').getDisplayCountry(locale) États-Unis

Slide 26

Slide 26 text

for code in Locale.getISOCountries():

Slide 27

Slide 27 text

for code in Locale.getISOCountries(): country = Locale('', code)

Slide 28

Slide 28 text

for code in Locale.getISOCountries(): country = Locale('', code) countries.append(country.getDisplayCountry(locale))

Slide 29

Slide 29 text

for code in Locale.getISOCountries(): country = Locale('', code) countries.append(country.getDisplayCountry(locale)) Andorre Émirats arabes unis Afghanistan Antigua-et-Barbuda Anguilla

Slide 30

Slide 30 text

from icu import Locale, Collator locale = Locale('fr')

Slide 31

Slide 31 text

from icu import Locale, Collator locale = Locale('fr') collator = Collator.createInstance(locale)

Slide 32

Slide 32 text

from icu import Locale, Collator locale = Locale('fr') collator = Collator.createInstance(locale) countries = sorted(countries, key=collator.getSortKey)

Slide 33

Slide 33 text

from icu import Locale, Collator locale = Locale('fr') collator = Collator.createInstance(locale) countries = sorted(countries, key=collator.getSortKey) Afghanistan Afrique du Sud Albanie Algérie Allemagne

Slide 34

Slide 34 text

twitter_cldr Ruby gem

Slide 35

Slide 35 text

require 'twitter_cldr'

Slide 36

Slide 36 text

require 'twitter_cldr' DateTime.now.localize(:ja).to_full_s

Slide 37

Slide 37 text

require 'twitter_cldr' DateTime.now.localize(:ja).to_full_s 2014 年 6 月 26 日木曜日 14 時 30 分 00 秒 UTC +00:00

Slide 38

Slide 38 text

require 'twitter_cldr' DateTime.now.localize(:es).to_full_s jueves, 26 de junio de 2014, 14:30:00 (UTC +00:00)

Slide 39

Slide 39 text

require 'twitter_cldr' DateTime.now.localize(:es).to_long_s 26 de junio de 2014, 14:30:00 UTC

Slide 40

Slide 40 text

require 'twitter_cldr' DateTime.now.localize(:es).to_medium_s 26/6/2014 14:30:00

Slide 41

Slide 41 text

require 'twitter_cldr' DateTime.now.localize(:es).to_short_s 26/6/14 14:30

Slide 42

Slide 42 text

require 'twitter_cldr' DateTime.now.localize(:es) .to_additional_s('yQQQQ') 2.º trimestre de 2014

Slide 43

Slide 43 text

require 'twitter_cldr' DateTime.now.localize(:es) .to_additional_s('yQQQ') T2 2014

Slide 44

Slide 44 text

require 'twitter_cldr' 1234.5.localize(:es).to_s 1 234,5

Slide 45

Slide 45 text

CLDR::Number Perl CPAN module

Slide 46

Slide 46 text

$cldr = CLDR::Number->new(locale => 'es');

Slide 47

Slide 47 text

$cldr = CLDR::Number->new(locale => 'es'); $decf = $cldr->decimal_formatter;

Slide 48

Slide 48 text

$cldr = CLDR::Number->new(locale => 'es'); $decf = $cldr->decimal_formatter; say $decf->format(1234.5);

Slide 49

Slide 49 text

$cldr = CLDR::Number->new(locale => 'es'); $decf = $cldr->decimal_formatter; say $decf->format(1234.5); 1 234,5

Slide 50

Slide 50 text

$decf->locale('es-MX'); say $decf->format(1234.5); 1,234.5

Slide 51

Slide 51 text

$decf->locale('ar'); say $decf->format(1234.5); ١٬٢٣٤٫٥

Slide 52

Slide 52 text

$decf->locale('bn'); say $decf->format(123000); ১,২৩,০০০

Slide 53

Slide 53 text

$decf->locale('bn'); say $decf->format(12300000); ১,২৩,০০,০০০

Slide 54

Slide 54 text

$perf = $cldr->percent_formatter( locale => 'tr' );

Slide 55

Slide 55 text

$perf = $cldr->percent_formatter( locale => 'tr' );

Slide 56

Slide 56 text

$perf = $cldr->percent_formatter( locale => 'tr' ); say $perf->format(0.05);

Slide 57

Slide 57 text

$perf = $cldr->percent_formatter( locale => 'tr' ); say $perf->format(0.05); %5

Slide 58

Slide 58 text

$perf->locale('ar'); say $perf->format(0.05); ٥٪

Slide 59

Slide 59 text

$perf->locale('fr'); say $perf->format(0.05); 5 %

Slide 60

Slide 60 text

$perf->permil(1); say $perf->format(0.05); 50 ‰

Slide 61

Slide 61 text

$curf = $cldr->currency_formatter( locale => 'en', currency_code => 'USD', );

Slide 62

Slide 62 text

$curf = $cldr->currency_formatter( locale => 'en', currency_code => 'USD', );

Slide 63

Slide 63 text

$curf = $cldr->currency_formatter( locale => 'en', currency_code => 'USD', ); say $curf->format(9.99);

Slide 64

Slide 64 text

$curf = $cldr->currency_formatter( locale => 'en', currency_code => 'USD', ); say $curf->format(9.99); $9.99

Slide 65

Slide 65 text

$curf->locale('en-CA'); say $curf->format(9.99); US$9.99

Slide 66

Slide 66 text

$curf->locale('fr-CA'); say $curf->format(9.99); 9,99 $US

Slide 67

Slide 67 text

$curf->locale('fr-CA'); $curf->currency_code('CAD') say $curf->format(9.99); 9,99 $

Slide 68

Slide 68 text

$curf->locale('bn'); $curf->currency_code('INR'); say $curf->format(123000); ১,২৩,০০০.০০₹

Slide 69

Slide 69 text

$decf->locale('en'); translate( '[_1]–[_2] of [_3]', $decf->format(1), $decf->format(25), $decf->format(1500), );

Slide 70

Slide 70 text

$decf->locale('en'); translate( '[_1]–[_2] of [_3]', $decf->format(1), $decf->format(25), $decf->format(1500), ); 1–25 of 1,500

Slide 71

Slide 71 text

$decf->locale('en'); translate( '[_1] of [_2]', $decf->range(1, 25), $decf->format(1500), ); 1–25 of 1,500

Slide 72

Slide 72 text

$decf->locale('ja'); translate( '[_1] of [_2]', $decf->range(1, 25), $decf->format(1500), ); 1 ~ 25 の 1,500

Slide 73

Slide 73 text

$decf->locale('ja'); $decf->numbering_system('fullwide'); translate( '[_1] of [_2]', $decf->range(1, 25), $decf->format(1500), ); 1~25の1 , 500

Slide 74

Slide 74 text

$decf->locale('ja-u-nu-fullwide'); translate( '[_1] of [_2]', $decf->range(1, 25), $decf->format(1500), ); 1~25の1 , 500

Slide 75

Slide 75 text

Libraries C/C++ ICU4C Java ICU4J

Slide 76

Slide 76 text

Libraries Ruby cldr twitter-cldr-rb Misc. RubyGems

Slide 77

Slide 77 text

Libraries Ruby cldr twitter-cldr-rb Misc. RubyGems Perl Misc. CPAN

Slide 78

Slide 78 text

Libraries Ruby cldr twitter-cldr-rb Misc. RubyGems Perl Misc. CPAN Go text/cldr Misc.

Slide 79

Slide 79 text

Libraries JavaScript cldr.js twitter-cldr-js twitter-cldr-npm Globalize

Slide 80

Slide 80 text

ICU4C Wrappers Python PyICU PHP intl Erlang i18n

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

Questions? Nova Patch @novapatch Shutterstock

Slide 83

Slide 83 text

Thank you! Nova Patch @novapatch Shutterstock