Upload
others
View
11
Download
0
Embed Size (px)
Citation preview
CLDR
New Advanced Topics
Steven R. Loomis, IBM
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2951 / 41
About Me…
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2952 / 41
About Me…
Not John Emmons
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2953 / 41
About Me…
Not John EmmonsIBM Global Foundations Technology Team
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2954 / 41
About Me…
Not John EmmonsIBM Global Foundations Technology TeamParticipant: CLDR-TC
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2955 / 41
What is CLDR?
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2956 / 41
Unicode gives you the world…“Unicode provides a unique number for every character, no matter what theplatform, no matter what the program, no matter what the language.” (unicode.org)
Photo Credit: NASA Earth Observatory
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2957 / 41
CLDR data brings it home…“The Unicode CLDR provides key building blocks for so�ware to support the world'slanguages, with the largest and most extensive standard repository of locale dataavailable.” (cldr.unicode.org)
Photo Credits: james.thompson,Per Ola Wiberg
~ Powi, Tom Ravenscro�
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2958 / 41
Advanced Topics
Validity DataDay PeriodsUnit Context and Usage
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl2959 / 41
Validity Data
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29510 / 41
Problem: What's a valid locale?Ensuring that my application can at least identify all valid language codesis important for the delivery of relevant content.
@Marvin, stackoverflow.com/q/36089760/185799
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29511 / 41
Problem: What's a valid locale?Ensuring that my application can at least identify all valid language codesis important for the delivery of relevant content.
@Marvin, stackoverflow.com/q/36089760/185799
Solution: Validity Data
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29512 / 41
Validity Data : types
language (en)script (Latn)region (US)subdivision (US-CA)variant (FONIPA)currency (USD)unit (energy-kilowatt-hour)
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29513 / 41
Validity Example : Script
regular : Arab, Latn, Taml, …deprecated : Qaai, …special : Zmth, …private_use : Qaaa, Qaab, …unknown : Zzzz
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29514 / 41
Validity : String Range
Qaaa~h →Qaab
Qaac
…
Qaah
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29515 / 41
Validity : XML Example<supplementalData> <idValidity> <id type="script" idStatus="regular"> Adlm Aghb Ahom … </id> <id type="script" idStatus="special"> Zmth Zsye … </id> <id type="script" idStatus="deprecated"> Qaai </id> <id type="script" idStatus="private_use"> Qaaa~h Qaaj~z Qaba~x </id> <id type="script" idStatus="unknown"> Zzzz </id> </idValidity></supplementalData>40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl295
16 / 41
Validity Data : More Info
Spec:
unicode.org/reports/tr35/#Validity_Data
Data:
common/validity/*.xml
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29517 / 41
Day Periods
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29518 / 41
Day Periods : 12 hour clock
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29519 / 41
24
6
12
18
1
Day Periods : 24 hour clock
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29520 / 41
24
6
12
18
1
Day Periods : 24 hour clock
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29521 / 41
AMPM
1-12
1-12
24
6
12
18
1
Day Periods : AM/PM
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29522 / 41
AMPM
1-12
1-12
24
6
12
18
1
Day Periods : AM/PM
AM - Ante MeridianPM - Post Meridian
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29523 / 41
AMPM
1-12
1-12
24
6
12
18
1
Day Periods : AM/PM
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29524 / 41
Day Periods : XML Rules<dayPeriodRules locales="root"> <dayPeriodRule type="am" from="00:00" before="12:00"/> <dayPeriodRule type="pm" from="12:00" before="24:00"/></dayPeriodRules><dayPeriodRules locales="en"> <dayPeriodRule type="midnight" at="00:00"/> <dayPeriodRule type="noon" at="12:00"/> <dayPeriodRule type="morning1" from="06:00" before="12:00"/> <dayPeriodRule type="afternoon1" from="12:00" before="18:00"/> <dayPeriodRule type="evening1" from="18:00" before="21:00"/> <dayPeriodRule type="night1" from="21:00" before="06:00"/></dayPeriodRules>
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29525 / 41
24
6
12
18
1
6pm
Night
Morning
Afternoon
Evening
Night
Noon
Midnight
9pm
Day Periods : English
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29526 / 41
Day Periods : XML Spanish<dayPeriodRules locales="es"> <dayPeriodRule type="noon" at="12:00"/> <!-- mediodía -->
<dayPeriodRule type="morning1" from="00:00" before="06:00"/> <!-- madrugada -->
<dayPeriodRule type="morning2" from="06:00" before="12:00"/> <!-- mañana -->
<dayPeriodRule type="evening1" from="12:00" before="20:00"/> <!-- tarde -->
<dayPeriodRule type="night1" from="20:00" before="24:00"/> <!-- noche --></dayPeriodRules>
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29527 / 41
24
6
12
18
1
6pm
madrugada
mañan
a
noche
8pm
tarde
mediodía
Day Periods : Spanish
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29528 / 41
Day Periods : More Details
Spec:
unicode.org/reports/tr35/tr35-dates.html#dayPeriods
Charts:
unicode.org/cldr/charts/latest/supplemental/day_periods.html
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29529 / 41
accelerationgforceaccelerationmeterper
secondsquaredanglerevolutionanglerad
ianangledegreea
nglearcminuteanglearcsecondareasqua
rekilometerareahectareareasquaremete
rareasquarecenti
meterareasquaremileareaacreareasqua
reyardareasquarefootareasquareinchco
ncentrkaratconc
entrmilligramperdeciliterconcentrmillimo
leperliterconcentrpartpermillionconsump
tionliterperkilom
eterconsumptionliterperkilometersconsu
mptionmilepergallonUSconsumptionmile
pergallonimperi
aldigitalterabytedigitalterabitdigitalgigab
ytedigitalgigabitdigitalmegabytedigitalm
egabitdigitalkilob
ytedigitalkilobitdigitalbytedigitalbitduratio
ncenturydurationyeardurationyearperson
durationmonth
durationmonthpersondurationweekdurat
ionweekpersondurationdaydurationdayp
ersondurationh
ourdurationminutedurationseconddurat
ionmilliseconddurationmicroseconddura
tionnanosecondel
ectricampereelectricmilliampereelectrico
hmelectricvoltenergykilocalorieenergyca
lorieenergyfood
calorieenergykilojouleenergyjouleenergy
kilowatthourfrequencygigahertzfrequenc
ymegahertzfreq
uencykilohertzfrequencyhertzlengthkilo
meterlengthmeterlengthdecimeterlength
centimeterlength
millimeterlengthmicrometerlengthnanom
eterlengthpicometerlengthmilelengthyar
dlengthfootlengt
hinchlengthparseclengthlightyearlengtha
stronomicalunitlengthfurlonglengthfatho
mlengthnautical
milelengthmilescandinavianlightluxmass
metrictonmasskilogrammassgrammass
milligrammassmi
crogrammasstonmassstonemasspound
massouncemassouncetroymasscaratpo
wergigawattpow
ermegawattpowerkilowattpowerwattpow
ermilliwattpowerhorsepowerpressurehe
ctopascalpressu
remillimeterofmercurypressurepoundpe
rsquareinchpressureinchhgpressuremil
libarspeedkilomet
erperhourspeedmeterpersecondspeedm
ileperhourspeedknottemperaturegeneric
temperaturecel
siustemperaturefahrenheittemperaturek
elvinvolumecubickilometervolumecubic
metervolumecubi
ccentimetervolumecubicmilevolumecubi
cyardvolumecubicfootvolumecubicinchv
olumemegaliterv
olumehectolitervolumelitervolumedecilit
ervolumecentilitervolumemillilitervolume
pintmetricvolume
cupmetricvolumeacrefootvolumebushel
volumegallonUSvolumegallonimperialv
olumequartvolum
epintvolumecupvolumefluidouncevolum
etablespoonvolumeteaspoon
Unit Context and Usage
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29530 / 41
Problem: Which unit?
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29531 / 41
Problem: Which unit?
Your destination is 85,008 yards away
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29532 / 41
Problem: Which unit?
Your destination is 85,008 yards away
1.1439×10-5 decades
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29533 / 41
Problem: Which unit?
Your destination is 85,008 yards away
1.1439×10-5 decades (with traffic)
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29534 / 41
Problem: Which unit?
Your destination is 85,008 yards away
1.1439×10-5 decades (with traffic)557 albums, 2,495,941,416 milliseconds of music
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29535 / 41
Problem: Which unit?
Your destination is 85,008 yards away
1.1439×10-5 decades (with traffic)557 albums, 2,495,941,416 milliseconds of music
According to Wikipedia, The speed of light is 1.8026×1012 furlongs/fortnight.
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29536 / 41
Unit Context : Length<unitPreferences category="length" usage="person">
<unitPreference regions="001">centimeter</unitPreference>
<unitPreference regions="AT BE DZ EG ES FR HK ID IL IT…">meter centimeter</unitPreference>
<unitPreference regions="US">inch</unitPreference>
</unitPreferences>
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29537 / 41
Unit Context : Length<unitPreferences category="length" usage="person">
<unitPreference regions="001">centimeter</unitPreference>
<unitPreference regions="AT BE DZ EG ES FR HK ID IL IT…">meter centimeter</unitPreference>
<unitPreference regions="US">inch</unitPreference>
</unitPreferences>
<unitPreferences category="length" usage="rainfall">
<unitPreference regions="001">millimeter</unitPreference>
<unitPreference regions="BR">centimeter</unitPreference>
<unitPreference regions="US">inch</unitPreference>
</unitPreferences>
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29538 / 41
Unit Context : Length<unitPreferences category="length" usage="person">
<unitPreference regions="001">centimeter</unitPreference>
<unitPreference regions="AT BE DZ EG ES FR HK ID IL IT…">meter centimeter</unitPreference>
<unitPreference regions="US">inch</unitPreference>
</unitPreferences>
<unitPreferences category="length" usage="rainfall">
<unitPreference regions="001">millimeter</unitPreference>
<unitPreference regions="BR">centimeter</unitPreference>
<unitPreference regions="US">inch</unitPreference>
</unitPreferences>
<unitPreferences category="length" usage="vehicle">
<unitPreference regions="001">meter</unitPreference>
<unitPreference regions="GB US">foot inch</unitPreference>
<unitPreference regions="MX">meter centimeter</unitPreference>
</unitPreferences>
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29539 / 41
Unit Context : More Details
Spec:
unicode.org/reports/tr35/tr35-info.html#Preferred_Units_For_Usage
40th Internationalization and Unicode Conference • Nov 2nd, 2016 — @srl29540 / 41
Thanks/Q&A
Social: @srl295
Slides/Contact: https://git.io/srl295
Email: srloomis @ us.ibm.com
made with remark.js SVG: intaglio • fork me on GitHub
41 / 41