Slide 1

Slide 1 text

3ZVTFJ4BKJLJ!TBKJLJY *OUMͷࠓ·Ͱͱ͜Ε͔Β

Slide 2

Slide 2 text

4BKJ3ZVTFJ4BKJLJ 'SPOUFOE%FWFMPQFSBU$ZCP[V JOD 𝕏 !TBKJLJY

Slide 3

Slide 3 text

ΞδΣϯμ *OUMͱ͸ *OUMࡦఆ·Ͱͷྺ࢙ *OUMͷ͜Ε·ͰͷਐԽɾαϙʔτ *OUMʹؔ࿈͢Δ࢓༷ͨͪ *OUMͷ͜Ε͔Β

Slide 4

Slide 4 text

*OUMͱ͸

Slide 5

Slide 5 text

8IBUJT*OUM࢓༷ॻʹΑΔͱ This Standard de fi nes the application programming interface for ECMAScript objects that support programs that need to adapt to the linguistic and cultural conventions used by different human languages and countries.(from ECMA-402, 10th edition) ͜ͷඪ४͸ɺҟͳΔਓؒͷݴޠ΍ࠃͰ࢖༻͞ΕΔݴޠతɾจԽతͳ׳शʹదԠ ͢Δඞཁͷ͋ΔϓϩάϥϜΛαϙʔτ͢ΔECMAScriptΦϒδΣΫτͷΞϓϦέ ʔγϣϯϓϩάϥϛϯάΠϯλϑΣʔεΛఆٛ͢Δɻ

Slide 6

Slide 6 text

΋͏ͪΐͬͱ۩ମతʹ +BWB4DSJQUͷࠃࡍԽ"1*ͷ໊લۭؒ Intl.ʓʓ ҎԼͷΑ͏ʹݴޠʹґଘͨ͠ػೳΛఏڙ͢Δ w ೔࣌ɾ਺஋ͷϑΥʔϚοτ w ϩέʔϧͷղܾ w ݴޠʹґଘͨ͠จࣈྻͷൺֱ w ςΩετ۠੾Γɾෳ਺ܗͷ൑ผ

Slide 7

Slide 7 text

*OUMͷ࢓༷తͳҐஔ෇͚ +BWB4DSJQUͷ࢓༷Ͱ͋Δ&$."ͷʮ֦ு࢓༷ʯͱ͍͏Ґஔ෇͚ɻ &$."ͱ͸۠ผͯ͠&$."ͱ͍͏࢓༷൪߸͕͍͍ͭͯΔɻ 1SPQPTBMͷ؅ཧ΍ձٞʹ΋෼͚ͯਐΊΒΕ͍ͯΔ &$." &$." *OUM ࣗ෼͕ͨͪ+BWB4DSJQUͷ࢓༷ͱଊ͍͑ͯΔ΋ͷ

Slide 8

Slide 8 text

࢖͍ํͱ֤"1*Λͬ͘͟Γ঺հ

Slide 9

Slide 9 text

*OUMͷ"1*֓ཁ *OUM͸̎ͭͷϝιουͱͭ̕ͷίϯετϥΫλϓϩύςΟΛ͍࣋ͬͯΔ w ϝιου͸ิॿతͳ΋ͷͰϝΠϯͷػೳ͸ίϯετϥΫλϓϩύςΟܦ༝ Α͘࢖͏ίϯετϥΫλϓϩύςΟ • ✨Intl.DateTimeFormat() • ✨Intl.NumberFormat() • Intl.RelativeTimeFormat() / Intl.Segmenter() / Intl.PluralRules()

Slide 10

Slide 10 text

*OUMͷ"1*֓ཁ શͯͷίϯετϥΫλϓϩύςΟ͸MPDBMFͱ0QUJPOͷ̎ͭΛҾ਺ʹऔΔ w -PDBMF࢖༻͢ΔMPDBMFɻݴޠλά͔-PDBMFΦϒδΣΫτͰࢦఆɻ w ྫ“ja-JP”, “en-US” w 0QUJPOGPSNBUͳͲʹ͓͚ΔΦϓγϣϯɻ w ྫ{calender : "japanese"} ࢖༻͢ΔྐྵΛ࿨ྐྵʹ͢Δ ίϯετϥΫλΛॳظԽ͢ΔࡍʹϩέʔϧͱϑΥʔϚοτͳͲͷΦϓγϣϯΛࢦ ఆ͢Δͷ͕ϙΠϯτ

Slide 11

Slide 11 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); શମ૾

Slide 12

Slide 12 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); ϩέʔϧͷࢦఆ

Slide 13

Slide 13 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); Φϓγϣϯͷࢦఆ

Slide 14

Slide 14 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); ίϯετϥΫλϓϩύςΟΛOFX

Slide 15

Slide 15 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); ࣮ࡍʹGPSNBUϝιουΛݺͼग़͢

Slide 16

Slide 16 text

࢖͍ํͷྫ const formatter = new Intl.NumberFormat("en", { notation: "compact", compactDisplay: "long", }); formatter.format(123456789); // → 123 million ϑΥʔϚοτ͞ΕΔʂ

Slide 17

Slide 17 text

Α͘࢖͏ػೳ*OUM%BUF5JNF'PSNBU ݴޠ͝ͱʹҟͳΔ೔࣌ͷϑΥʔϚοτΛߦ͏ format()ϝιουͱformatRange()ϝιουΛ࣋ͭ w format()“12/07/2015” w formatRange()“12/07/2015 ~ 12/09/2015” ͦΕͧΕ“ToParts”ͷ͍ͭͨόʔδϣϯͷϝιου΋͋Δ • formatToParts() / formatRangeToParts() w ϑΥʔϚοτจࣈྻΛҙຯ͝ͱʹ۠੾ͬͨ഑ྻͰग़ྗͯ͘͠ΕΔ

Slide 18

Slide 18 text

*OUM%BUF5JNF'PSNBUͷ࢖༻ྫ const formatter = Intl.DateTimeFormat('en-US', { dateStyle: 'short' }); const date = new Date(Date.UTC(2023, 10, 19)); formatter.format(date); // → 11/19/23 formatter.formatToParts(date); // [ // { type: 'month', value: '11' }, // { type: 'literal', value: '/' }, // { type: 'day', value: ’19' }, // { type: 'literal', value: '/' }, // { type: 'year', value: '23' } // ];

Slide 19

Slide 19 text

Α͘࢖͏ػೳ*OUM/VNCFS'PSNBU ७ਮͳ਺஋͚ͩͰͳ͘୯Ґ΍௨՟ɺύʔηϯτΛؚΜͩ਺஋ͷϑΥʔϚοτ w “decimal”ྫ “123.4” w “currency”ྫ “$123.4” w “percent”ྫ “123.4%” w “unit”ྫ “123.4km/h” ϝιου͸%BUF5JNF'PSNBUͱಉ༷ w format()/formatRange()/formatToParts()/formatRangeToParts()

Slide 20

Slide 20 text

*OUM/VNCFS'PSNBUͷ࢖༻ྫ ਺஋ const compactFormatter = new Intl.NumberFormat('en', { style: 'decimal', notation: 'compact' }); compactFormatter.format(1000000); // '1M' const FourDigitFormatter = new Intl.NumberFormat('en', { style: 'decimal', maximumSignificantDigits: 4 }); FourDigitFormatter.format(123.456); // "123.5"

Slide 21

Slide 21 text

*OUM/VNCFS'PSNBUͷ࢖༻ྫ ௨՟ const enFormatter = new Intl.NumberFormat("en", { style: "currency", currency: "USD", }); enFormatter.format(12345); // “$12,345.00” const jaFormatter = new Intl.NumberFormat("ja", { style: “currency", currency: "JPY", }); jaFormatter.format(12345); // “ˇ12,345”

Slide 22

Slide 22 text

*OUM/VNCFS'PSNBUͷ࢖༻ྫ ୯Ґ const formatter = new Intl.NumberFormat("en", { style: "unit", unit: "foot", unitDisplay: "long", }); formatter.format(1); // → 1 foot formatter.format(2); // → 2 feet

Slide 23

Slide 23 text

ଞʹ΋͋Δ*OUMͷศརͳػೳ Intl.RelativeTimeFormat() w ʮ໌೔ʯ΍ʮ͓ͱͱ͍ʯͷΑ͏ͳ૬ରతͳ೔࣌දهͷࠃࡍԽΛߦ͏ Intl.Segmenter() w จࣈɾ୯ޠɾจ͝ͱͷ෼ͪॻ͖Λߦ͏ Intl.PluralRules() w ݴޠ͝ͱͷෳ਺ܗϧʔϧ෼ྨ΍ং਺ TU OEʜ Λฦ͢

Slide 24

Slide 24 text

ͦΜͳ*OUMɺ ࣮͸ྺ࢙͕௕͍ΜͰ͢

Slide 25

Slide 25 text

*OUMࡦఆ·Ͱͷྺ࢙

Slide 26

Slide 26 text

ḪΔ͜ͱ೥લ

Slide 27

Slide 27 text

UINFFUJOHPG5$ (PPHMFͷ/FCPKãB㶎JSJ㶛ࢯͱ+VOHTIJL4IJOࢯʹΑͬͯఏҊ͞Εͨ

Slide 28

Slide 28 text

ࡦఆ։࢝౰࣌ʹ͓͚Δ՝୊ײ 🤔&$."4DSJQU͸ࠃࡍԽػೳΛݶఆతʹ͔͠αϙʔτ͍ͯ͠ͳ͔ͬͨ w Date.toLocaleString()ͷΑ͏ͳॳาతͳιʔτ΍ϑΥʔϚοτػೳͷΈ 🤔จࣈྻιʔτͷ࣮૷͕ϒϥ΢βʹΑͬͯҟͳΔ w ϒϥ΢βؒͰͷ&$."4DSJQUΤϯδϯͷ࣮૷͕·ͪ·ͪ

Slide 29

Slide 29 text

*OUMࡦఆલʹߟ͑ΒΕͯͨղܾํ๏ͱ໰୊఺ ೔෇΍௨՟ΛϑΥʔϚοτ͢Δઐ༻ͷJOϥΠϒϥϦΛ࣮૷ˠγϯάϧϩ έʔϧσʔλʹόϯυϧ w 👎ϥΠϒϥϦͷαΠζͱҰ؏ੑͷͳ͍"1* w 👎ࣅͨػೳͷϥΠϒϥϦΛॏෳͯ͠Πϯετʔϧ͢Δ͜ͱʹͳΔՄೳੑ αʔόʔ্Ͱ͢΂ͯͷࠃࡍԽॲཧΛߦ͍ɺ݁ՌΛૹ৴͢Δɻ w 👎஗Ԇ͢Δ্ʹΦϯϥΠϯΞΫηεͱࠃࡍԽॲཧΛߦ͏αʔόʔ͕ඞཁ

Slide 30

Slide 30 text

Ұ؏ͨ͠&$."4DSJQU"1* Ͱղܾͩʂ

Slide 31

Slide 31 text

ࠃࡍԽ"1*ࡦఆʹΑͬͯͰ͖Δ͜ͱ 👍Ұ؏ͨ͠ࠃࡍԽ݁ՌΛฦͤΔ w $-%3΍ओཁͳϓϥοτϑΥʔϜͷϩέʔϧαϙʔτͱಉϨϕϧ 👍ΞϓϦέʔγϣϯ͝ͱʹෳ਺ͷϩέʔϧΛαϙʔτͰ͖Δ w ϩέʔϧࣝผࢠ͸6OJDPEFඪ४ʹै͏ 👍౷Ұ͞Εͨ"1*ʹΑΓίʔυ಺ͰΦϒδΣΫτͷ࠶ར༻͕͠΍͘͢ͳΔ w ࡞੒ίετͷߴ͍ΦϒδΣΫτͩͱಛʹԸܙ͕͋Δ

Slide 32

Slide 32 text

ࠃࡍԽ"1*ࡦఆʹΑͬͯͰ͖Δ͜ͱ αʔόʔ্ͰࠃࡍԽΛߦ͏Θ͚Ͱ͸ͳ͍ͷͰʜ 👍αʔόʔ΁ͷݺͼग़͕͠ͳ͍ͨΊɺ଴͕ͪ࣌ؒͳ͍ɻ 👍ΦϑϥΠϯॲཧ΋࣮ݱͰ͖Δ ඪ४ػೳͷ"1*ͳͷͰʜ 👍ϖʔδ΍ΤΫεςϯγϣϯͷαΠζ͕૿Ճ͠ͳ͍

Slide 33

Slide 33 text

ॳ൛׬੒·ͰͷಓͷΓ *OUMͷݩͱͳΔఏҊ͕5$ͷ.FFUJOHͰ͞ΕΔ ࠷ॳͷࠃࡍԽ"1*.FFUJOH͕։࠵ 4USBXNBOQSPQPTBMW͕ެ։ ೥݄Ͱͷ࢓༷ࡦఆΛ໨ࢦ͢͜ͱʹͳΔ ୈdճͷࠃࡍԽ.FFUJOH ໊લۭؒͷ౷Ұɾػೳͷ࡟ݮɾपล࢓༷ͱͷௐ੔FUD ࠷ॳͷ%SBGU4QFD ͜ͷลΓͰ͋Δఔ౓࢓༷ΛݻΊΔ ࠷ޙͷ%SBGU4QFDJ fi DBUJPO %SBGU4QFDͷվળ࡞ۀɾ࣮૷࡞ۀ ໊લۭؒͷ໊લมߋɾ"1*ͷमਖ਼FUD

Slide 34

Slide 34 text

ͦͯ͠೥݄

Slide 35

Slide 35 text

TU&EJUJPOެ։ʂ🎉

Slide 36

Slide 36 text

TU&EJUJPOͷ֓ཁ ఆٛ͞ΕͨίϯετϥΫλϓϩύςΟ͸̏ͭ w *OUM$PMMBUPS w *OUM/VNCFS'PSNBU w *OUM%BUF5JNF'PSNBU طଘͷ࣮૷ͱͷ౷߹ w /VNCFSUP-PDBM4USJOH%BUFUP-PDBM4USJOHͷ֦ு

Slide 37

Slide 37 text

ݱࡏͷػೳͱൺ΂Δͱ ݁ߏγϯϓϧ

Slide 38

Slide 38 text

*OUMͷ͜Ε·ͰͷਐԽ

Slide 39

Slide 39 text

ࡦఆޙͷϒϥ΢βαϙʔτ

Slide 40

Slide 40 text

೥ TU&EJUJPOࡦఆ͔Β೥ $ISPNF *& 'JSFGPY 4BGBSJ %BUF5JNF'PSNBU ⚪︎ ˚ º º /VNCFS'PSNBU ⚪︎ ˚ º º $PMMBUPS ⚪︎ ˚ º º

Slide 41

Slide 41 text

೥ $ISPNF *& 'JSFGPY 4BGBSJ %BUF5JNF'PSNBU ⚪︎ ˚ ⚪︎ º /VNCFS'PSNBU ⚪︎ ˚ ⚪︎ º $PMMBUPS ⚪︎ ˚ ⚪︎ º

Slide 42

Slide 42 text

೥ $ISPNF *&ˠ&EHF 'JSFGPY 4BGBSJ %BUF5JNF'PSNBU ⚪︎ ⚪︎ ⚪︎ º /VNCFS'PSNBU ⚪︎ ⚪︎ ⚪︎ º $PMMBUPS ⚪︎ ⚪︎ ⚪︎ º

Slide 43

Slide 43 text

೥ $ISPNF *&ˠ&EHF 'JSFGPY 4BGBSJ %BUF5JNF'PSNBU ⚪︎ ⚪︎ ⚪︎ ⚪︎ /VNCFS'PSNBU ⚪︎ ⚪︎ ⚪︎ ⚪︎ $PMMBUPS ⚪︎ ⚪︎ ⚪︎ ⚪︎

Slide 44

Slide 44 text

೥ɺॳ൛ͰఏҊ͞Εͨ "1*܈͕Ұ௨Γ࢖͑ΔΑ͏ʹ 🎉

Slide 45

Slide 45 text

ػೳ໘΋ਐԽͯ͠·͢

Slide 46

Slide 46 text

ݱࡏͷ*OUM͸UI&EJUJPO OE&EJUJPO͕೥ɾͦͷޙ͸ຖ೥ࡦఆ

Slide 47

Slide 47 text

OE&EJUJPOҎ߱ͷ ػೳ௥ՃΛݟ͍ͯ͘

Slide 48

Slide 48 text

OE&EJUJPO େ͖ͳػೳ௥Ճͱ͍͏ΑΓपล࢓༷΍&4ͱͷڠௐ͕ϝΠϯ w &4ͱͷڠௐ w Array.toLocaleString()Λ௥Ճ w *"/"5JNF[POF/BNFΛड͚෇͚ΔΑ͏ʹ

Slide 49

Slide 49 text

SE&EJUJPO Intl.getCanonicalLocales(); // ॏෳ͕লུ͞Εɺ༗ޮͳݴޠλάͷ഑ྻΛฦ͢ console.log(Intl.getCanonicalLocales("EN-US")); // Array [“en-US"] console.log( Intl.getCanonicalLocales(["EN-US", "Fr"]), ); // Array ["en-US", "fr"]

Slide 50

Slide 50 text

UI UI&EJUJPO formatToParts() (DateTimeFormat / NumberFormat) // ҙຯ͝ͱʹformatจࣈྻΛ෼ׂͨ͠഑ྻͱͯ͠ฦ͢ const formatter = Intl.DateTimeFormat('en-US', {}); formatter.formatToParts(new Date(Date.UTC(2023, 10, 19))); // [ // { type: 'month', value: '11' }, // { type: 'literal', value: '/' }, // { type: 'day', value: ’19' }, // { type: 'literal', value: '/' }, // { type: 'year', value: '23' } // ];

Slide 51

Slide 51 text

UI&EJUJPO Intl.PluralRules // ং਺΍ෳ਺ܗͷϧʔϧΛ൑ผ͢Δػೳͷ௥Ճ const pluralRule = new Intl.PluralRules("en-US", { type: "ordinal", }); pluralRule.select(1); // → "one" : 1st pluralRule.select(2); // → "two" : 2nd pluralRule.select(3); // → "few" : 3rd pluralRule.select(13); // → "other" : 13th pluralRule.select(103); // → "few" : 103rd

Slide 52

Slide 52 text

UI&EJUJPO Intl.RelativeTimeFormat // ʮࡢ೔ʯͷΑ͏ͳ૬ରతͳ೔࣌දهͷϑΥʔϚοτ const rtfEn = new Intl.RelativeTimeFormat("en", { numeric: "auto", }); rtfEn.format(1, "day"); // "tomorrow" const rtfJa = new Intl.RelativeTimeFormat("ja", { numeric: "auto", }); rtfJa.format(2, "day"); // "໌ޙ೔"

Slide 53

Slide 53 text

UI&EJUJPO Intl.Locale Object // ϩέʔϧ৘ใΛΑΓ؆୯ʹૢ࡞ɾ؅ཧͰ͖Δ const korean = new Intl.Locale("ko", { script: "Kore", region: "KR", hourCycle: "h23", calendar: "gregory", }); console.log(korean.hourCycle); // "h23"

Slide 54

Slide 54 text

UI&EJUJPO Intl.ListFormat // ݴޠΛߟྀͨ͠Ϧετ(and/orͰͲ͏ܨ͙͔)ͷϑΥʔϚοτ const languages = ['JavaScript', 'JavaScript', 'HTML']; const formatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction', }); console.log(formatter.format(languages)); // "JavaScript, JavaScript, and HTML"

Slide 55

Slide 55 text

UI&EJUJPO Intl.DisplayNames // ݴޠ໊ɺ஍Ҭ໊ɺจࣈମܥ໊ࣗମͷදࣔΛࠃࡍԽ const regionNamesInJapanese = new Intl.DisplayNames( ["ja"], { type: "language" }, ); regionNamesInJapanese.of("en"); // “ӳޠ” regionNamesInJapanese.of("ja"); // “೔ຊޠ"

Slide 56

Slide 56 text

UI&EJUJPO DateTimeFormat:formatRange() // ೔࣌ͷظؒදهͷϑΥʔϚοτΛߦ͏ const formatter = Intl.DateTimeFormat('en-US', { dateStyle: 'short' }); const dateStart = new Date(Date.UTC(2023, 10, 18)); const dateEnd = new Date(Date.UTC(2023, 10, 19)); formatter.formatRange(dateStart, dateEnd); // '11/18/23 – 11/19/23'

Slide 57

Slide 57 text

UI&EJUJPO 'dayStyle','timeStyle' in DateTimeFormat // ҙຯ͝ͱʹformatจࣈྻΛ෼ׂͨ͠഑ྻͱͯ͠ฦ͢ const dateFormatter = Intl.DateTimeFormat("en-US", { dateStyle: "short", }); const timeFormatter = Intl.DateTimeFormat("en-US", { timeStyle: "long", }); const date = new Date(Date.UTC(2023, 10, 19)) dateFormatter.format(date); // “11/19/23" timeFormatter.format(date); // "9:00:00 AM GMT+9"

Slide 58

Slide 58 text

UI&EJUJPO Intl.Segmenter // จࣈɾ୯ޠɾจ͝ͱͷ෼ͪॻ͖Λߦ͏ const segmenter = new Intl.Segmenter("ja-JP", { granularity: "word" }, ); console.log([...segmenter.segment("ޗഐ͸ೣͰ͋Δɻ")]); // [ // {"segment": "ޗഐ", "index": 0, "isWordLike": true}, // {"segment": "͸", "index": 2, "isWordLike": true}, // ...(ུ)

Slide 59

Slide 59 text

UI&EJUJPO Intl.DisplayNames v2 // ΧϨϯμʔ໊ɺ೔࣌ͷϥϕϧ໊ࣗମͳͲͷදࣔΛࠃࡍԽ const calendarNamesInJapanese = new Intl.DisplayNames( ["ja"], { type: "calendar" }, ); calendarNamesInJapanese.of("japanese"); // “࿨ྐྵ” const dateTimeNamesInJapanese = new Intl.DisplayNames( ["ja"], { type: "dateTimeField" }, ); dateTimeNamesInJapanese.of("dayPeriod"); // “ޕલ/ޕޙ”

Slide 60

Slide 60 text

UI&EJUJPO Intl Enumeration API // ͦͷ࣮૷Ͱαϙʔτ͞Ε͍ͯΔྐྵɺর߹ॱংɺͳͲͷ഑ྻΛฦ͢ Intl.supportedValuesOf("calendar"); // ['buddhist', 'chinese', 'coptic', ‘dangi’, …]; Intl.supportedValuesOf("currency"); // [‘AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', ‘ARS’, …] Intl.supportedValuesOf("numberingSystem"); // [‘adlm', 'ahom', 'arab', 'arabext', 'bali', …] Intl.supportedValuesOf("timeZone"); // ['Africa/Abidjan', 'Africa/Accra', …]

Slide 61

Slide 61 text

UI&EJUJPO Intl.NumberFormat v3 // formatRange()ϝιουͷαϙʔτ const formatter = new Intl.NumberFormat('en', { style: 'decimal', }); formatter.formatRange(100, 200); // ‘100-200’ // ਺஋ͷؙΊΦϓγϣϯͳͲͷॆ࣮ const compactFormatter = new Intl.NumberFormat('en', { style: ‘decimal', maximumFractionDigits: 0 }); compactFormatter.formatR(3.14); // ‘3’

Slide 62

Slide 62 text

TU&EJUJPOd·Ͱͷػೳ௥Ճ + Intl.getCanonicalLocales() + Intl.ListFormat + Intl.Segmenter + Intl.DisplayNames + Intl.PluralRules + Intl.RelativeTimeFormat + Intl.Locale + formatToParts() + formatRange() + DateTimeFormat option + NumberFormat option(v3) … and more

Slide 63

Slide 63 text

௥Ճ͞Εͨػೳͷαϙʔτ

Slide 64

Slide 64 text

ݱࡏͷαϙʔτঢ়گ $ISPNF &EHF 'JSFGPY 4BGBSJ %BUF5JNF'PSNBU /VNCFS'PSNBU 4FHNFOUFS º 1MVSBM3VMFT 3FMBUJWF5JNF'PSNBU

Slide 65

Slide 65 text

ݱࡏͷαϙʔτঢ়گ $ISPNF &EHF 'JSFGPY 4BGBSJ 1MVSBM3VMFT -PDBMF0CKFDU -JTU'PSNBU %JTQMBZ/BNFT

Slide 66

Slide 66 text

👍جຊతʹ͸αϙʔτ

Slide 67

Slide 67 text

*OUMʹؔ࿈͢Δ࢓༷ͨͪ

Slide 68

Slide 68 text

ؔ࿈࢓༷Λ஌Δҙຯ &DNB4DSJQUಠࣗͰܾΊΔΘ͚ʹ͸ߦ͚ͳͦ͞͏ͳ໰୊͕୔ࢁ w αϙʔτ͢Δจࣈ΍ͦͷιʔτ͸ʁ w αϙʔτ͢ΔλΠϜκʔϯ͸ w ݴޠʹΑΔจ๏ࣄ߲ ෳ਺ܗͳͲʜ ͷ෼ྨͬͯʁ w ஍Ҭ΍ݴޠ໊Ͳ͏΍ͬͯ؅ཧ͢Δʁ ˠ*OUM͸ࠃࡍԽػೳͱ͍͏ੑ্࣭ɺଞͷඪ४࢓༷Λࢀর͢Δ෦෼͕ଟ͍

Slide 69

Slide 69 text

*OUMͱͷؔ࿈࢓༷શମ૾ *OUM *&5' #$1 *"/" 5JNF[POF *40 ௨՟ίʔυ 6OJDPEF -%.- $-%3

Slide 70

Slide 70 text

*OUMͱͷؔ࿈࢓༷6OJDPEF ҎԼ͸6OJDPEFͷ࢓༷ʹ४ڌ͍ͯ͠Δ w จࣈηοτ w จࣈྻͷ۠੾Γʹؔ͢Δ࢓༷ w 6OJDPEF4UBOEBSE"OOFY6OJDPEF5FYU4FHNFOUBUJPO w จࣈࣗମͷൺֱɾฒͼସ͑ʹؔ͢Δ࢓༷ w 6OJDPEF5FDIOJDBM4UBOEBSE6OJDPEF$PMMBUJPO"MHPSJUIN

Slide 71

Slide 71 text

*OUMͱͷؔ࿈࢓༷ͦ΋ͦ΋-%.-$-%3ͱ͸ -%.- 6OJDPEF-PDBMF%BUB.BSLVQ-BOHVBHF w ߏ଄Խ͞ΕͨϩέʔϧσʔλΛަ׵͢ΔͨΊͷ9.-ϑΥʔϚοτ $-%3 $PNNPO-PDBMF%BUB3FQPTJUPSZ w ੈք֤஍ͷݴޠʹ͓͚Δ༷ʑͳϩέʔϧɾσʔλΛ·ͱΊͨϨϙδτϦ w -%.-ͷܗࣜʹͦͬͯهड़͞Ε͍ͯΔ

Slide 72

Slide 72 text

*OUMͱͷؔ࿈࢓༷-%.-$-%3ͱ*OUM *OUM͸࢓༷ͷ֤ॴͰ-%.-४ڌͰ͋Δ͜ͱ͕໌ه͞Ε͍ͯΔ Intl.PluralRules w ෳ਺ܗͷύλʔϯɾϧʔϧ͸-%.-ͷݴޠෳ਺ϧʔϧʹ४ڌ Intl.ListFormat w ಺෦తͳσʔλͷܗࣜͱͯ͠-%.-ͷ-JTU1BUUFSOʹ४ڌ͢Δ͜ͱ -%.- ࢓༷ ʹ४ڌ͢Δ͜ͱͰ$-%3 ϩέʔϧσʔλ Λ׆༻͠΍͘͢ͳΔ w ʮ࣮૷ʹ͓͍ͯ$-%3Λར༻͢Δ͜ͱʯΛ֤ॴͰਪ঑͍ͯ͠Δ

Slide 73

Slide 73 text

*OUMͱͷؔ࿈࢓༷*&5' #$1 *&5'ͷ#$1ݴޠλάͷ࢓༷ *OUM͕αϙʔτ͢Δϩέʔϧจࣈྻ͸ͷ#$1ʹ४ڌ͍ͯ͠Δ #$1Ͱఆٛ͞Ε͍ͯΔ֦ுγʔέϯε΋*OUMͰ͸ར༻͢Δ w #$1֦ுγʔέϯε<จࣈ><dจࣈ><dจࣈ ೚ҙ >ͷܗͰλάΛ֦ ுͰ͖Δ࢓༷ w ݱࡏ*OUMͰղऍ͢Δͷ͸ͦͷதͷV 6OJDPEF ֦ு w ྫ ja-JP-u-ca-japanese u-ca-japaneseͷ෦෼

Slide 74

Slide 74 text

*OUMͱͷؔ࿈࢓༷*"/"*40 *"/"ͱͷؔ࿈ w Intl.DateTimeFormatͰtimeZoneΦϓγϣϯʹࢦఆͰ͖Δ஋ w *"/"λΠϜκʔϯσʔλϕʔεͷλΠϜκʔϯ໊ *40ͱͷؔ࿈ w Intl.NumberFormatͰcurrencyΦϓγϣϯʹࢦఆͰ͖Δ஋ w *40ͷ௨՟ίʔυ

Slide 75

Slide 75 text

*OUMͷ͜Ε͔Β

Slide 76

Slide 76 text

طʹ͋ΔϓϩύςΟͷൃలɾॆ࣮ Intl.NumberFormatW ઌड़ w ਺஋ͷؙΊΛத৺ʹΦϓγϣϯΛେ෯ʹ௥Ճͨ͠ɻ Intl.SegmenterW 4UBHF w จࣈɾ୯ޠɾจʹՃ͑ͯվߦ۠੾ΓͷαϙʔτΛఏҊ͍ͯ͠Δ

Slide 77

Slide 77 text

ఏҊ͞Ε͍ͯΔ৽͍͠ػೳͷ1SPQPTBM Ұ෦ ࠓճ঺հ͢Δ΋ͷ w Intl Local Info API 4UBHF w Intl.DurationFormat 4UBHF w Intl.MessageFormat 4UBHF

Slide 78

Slide 78 text

*OUM-PDBMF*OGP"1* 4UBHF ϩέʔϧ৘ใΛอ࣋͢ΔIntl.LocaleΦϒδΣΫτʹର༷ͯ͠ʑͳσʔλΛऔ ಘͰ͖ΔϝιουΛ௥Ճ͢ΔఏҊ w ྫ ʮจࣈΛॻ͘ํ޲ʯ΍ʮि࢝·Γʹ͍ͭͯͷ৘ใʯͳͲ const enGB = new Intl.Locale('en-GB'); enGB.getWeekInfo(); // {firstDay: 1, weekend: [6, 7], minimalDays: 4} let tl = enGB.getTextInfo(); // { direction: "rtl" }

Slide 79

Slide 79 text

*OUM%VSBUJPO'PSNBU ࣌ؒͷִؒදهΛϑΥʔϚοτ͢ΔػೳͷఏҊ w ྫ ࣌ؒ෼IPVSNJOVUFT new Intl.DurationFormat("fr-FR", { style: "long", }).format({ hours: 1, minutes: 46, seconds: 40, }); // => "1 heure, 46 minutes et 40 secondes"

Slide 80

Slide 80 text

*OUM.FTTBHF'PSNBUલఏ஌ࣝ *$6 *OUFSOBUJPOBM$PNQPOFOUTGPS6OJDPEF ͱ͸ w 6OJDPEF͕ϝϯςφϯε͍ͯ͠ΔࠃࡍԽͱ஍ҬԽʹؔ͢ΔϥΠϒϥϦ w ϑΥʔϚοτʹݶΒͣଟ͘ͷࠃࡍԽʹඞཁͳػೳΛ಺ଂ͍ͯ͠Δ *$6.FTTBHF'PSNBUʹ͍ͭͯ w *$6Ͱར༻͞Ε͍ͯΔϝοηʔδࠃࡍԽͷͨΊͷ'PSNBU w ϝοηʔδͷϓϨΠεϗϧμʔ΍จ๏ʹΑΔ৚݅෼ذͳͲΛදݱՄೳ

Slide 81

Slide 81 text

*OUM.FTTBHF'PSNBU *$6.FTTBHF'PSNBUΛղऍ͠ɺͦΕʹ४ڌͯ͠ϑΥʔϚοτ͢ΔػೳͷఏҊ ݱঢ়ಠࣗͷϝοηʔδϑΥʔϚοτ࢓༷͕ଟ͍ w 👎ΞϓϦέʔγϣϯଆͰ΋ಠࣗͷղੳॲཧ͕ඞཁʹͳΔ *$6.FTTBHF'PSNBUΛαϙʔτ͢Δͱʜ w 👍ΞϓϦέʔγϣϯຖʹϑΥʔϚοτͷղੳॲཧ͸͍Βͳ͘ͳΔ w 👍ۀքඪ४ͷπʔϧ΍ϓϩηεΛ࢖༻ͨ͠ϩʔΧϥΠζ͕༰қʹͳΔ

Slide 82

Slide 82 text

*OUM.FTTBHF'PSNBUྫ const source = ... // ্ͷϑΥʔϚοτจࣈྻ const mf = new Intl.MessageFormat(source, 'en'); const notifications = mf.format({ count: 1 }); // 'You have 1 new notification' match {$count :number} when 0 {You have no new notifications} when one {You have {$count} new notification} when * {You have {$count} new notifications} *$6ͷϑΥʔϚοτจࣈྻ .FTTBHF'PSNBUW

Slide 83

Slide 83 text

ଞͷ1SPQPTBMͱͷڠௐ

Slide 84

Slide 84 text

5FNQPSBMͱͷڠௐ5FNQPSBMͱ͸ Temporalͱ͸ w &$."4DSJQUͰ೔࣌Λૢ࡞͢ΔͨΊͷ৽͍͠"1*܈ w ݱࡏ4UBHFͷ1SPQPTBM ೔࣌ͷϑΥʔϚοτ΍αϙʔτ͢ΔΦϓγϣϯͳͲͰTemporalͱؔ࿈͢Δ ˠTemporalଆͰ*OUMʹ४ڌͨ͠࢓༷ࡦఆ͕ਐΊΒΕ͍ͯΔ

Slide 85

Slide 85 text

5FNQPSBMͱͷڠௐ Temporal͸*OUMΛલఏͱͯ͠"1*Λઃܭ͍ͯ͠Δ w TemporalͷtoLocaleString()͸Intl.DateTimeFormatͱಉ͡Ҿ਺ w Temporal.CalendarͰରԠ͢ΔΧϨϯμʔ͸Intl.DateTimeFormatͰα ϙʔτ͢Δ΋ͷͱҰॹ w ΧϨϯμʔͷղܾͳͲ͸*OUMଆͷ࢓༷Λࢀর͍ͯ͠Δ w Temporal.Duration͸Intl.DurationFormat TUBHF ͱಉ͡0QUJPOʹ ͳΔ༧ఆ

Slide 86

Slide 86 text

🤩ࠓޙΑΓศརʹ

Slide 87

Slide 87 text

·ͱΊ

Slide 88

Slide 88 text

·ͱΊ w *OUM͸਺஋೔࣌ͷϑΥʔϚοτʹݶΒͣݴޠʹґଘ༷ͨ͠ʑͳػೳΛఏڙ͢Δ w *OUMͷྺ࢙͸ݹ͘೥ۙ͘લ͔Β࢓༷ͷࡦఆͱαϙʔτ͕ঃʑʹਐΜͰ͖ͨ w ೥ݱࡏɺجຊతͳػೳͷ΄ͱΜͲΛ֤ϒϥ΢β͕αϙʔτ͍ͯ͠Δ w *OUM͸6OJDPEFΛ͸͡Ίͱ͢Δपล࢓༷ͱͷ࿈ܞ΋ີʹ࣮ͯ͠૷͞Ε͍ͯΔ w ࠓޙ΋৽͍͠ػೳ͕௥Ճ͞ΕΔ༧ఆͰ͋Γɺ5FNQPSBMͷΑ͏ͳ৽͍͠࢓༷ͷ ఏҊͱ΋ڠௐ͍ͯ͘͠ w ࠓͦ͜*OUMΛ࢖͍͜ͳ࣌͢ʂ

Slide 89

Slide 89 text

3ZVTFJ4BKJLJ!TBKJLJY ͋Γ͕ͱ͏͍͟͝·ͨ͠