Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React.js & i18n
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Eric Ferraiuolo
January 28, 2015
Programming
2
480
React.js & i18n
http://formatjs.io/
Eric Ferraiuolo
January 28, 2015
Tweet
Share
More Decks by Eric Ferraiuolo
See All by Eric Ferraiuolo
Node on the Road
ericf
1
130
Pure
ericf
7
980
YUI and The Future
ericf
2
750
YUI 3.10.0 — Go Fast
ericf
3
590
YUI, Open Source, and Community
ericf
0
460
Advocatus Diaboli – Throne of JS
ericf
8
16k
Y.App: Coordinating URL Navigation, Routing, and Managing Views
ericf
10
2.1k
Other Decks in Programming
See All in Programming
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
8
2k
AHC061解説
shun_pi
0
260
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
200
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.2k
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
540
AI活用のコスパを最大化する方法
ochtum
0
120
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
340
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
310
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
470
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
9
5.1k
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
2.8k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
66k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Site-Speed That Sticks
csswizardry
13
1.1k
Code Review Best Practice
trishagee
74
20k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
750
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
So, you think you're a good person
axbom
PRO
2
1.9k
WCS-LA-2024
lcolladotor
0
470
Thoughts on Productivity
jonyablonski
75
5.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Building the Perfect Custom Keyboard
takai
2
700
Transcript
React.js & i18n @ericf - Yahoo ReactConf
1.002 2/1/2015
But I only care about English in the USA!
English 5.2% 27% Native Speakers Internet Users Source: Wikipedia
None
None
None
Formatting
None
None
function numberWithCommas(x) { var parts = x.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,
","); return parts.join("."); } “How to print a number with commas as thousands separators in JavaScript?” 25 Answers
Intl.NumberFormat Intl.DateTimeFormat Intl.Collator
new Intl.NumberFormat().format(1000); new Intl.DateTimeFormat({ month: 'long', day : 'numeric', year
: 'numeric' }).format(Date.now()); 1,000 January 28, 2015 Intl Built-ins
<FormattedNumber value={1000} /> <FormattedDate value={Date.now()} month="long" day="numeric" year="numeric" /> React
Intl 1,000 January 28, 2015
<p className=“post-meta”> Posted <FormattedRelative value={this.props.date} /> </p> Relative Times Posted
3 hours ago
“Hello, {name}!” “You’re {age, number} years old.” String Messages
var msg = `{numComments, plural, one {# comment}
other {# comments} }`; <FormattedMessage message={msg} numComments={1} /> Pluralization 1 comment
var msg = `{numComments, plural, one {# comment}
other {# comments} }`; <FormattedMessage message={msg} numComments={1200} /> Pluralization 1,200 comments
var App = React.createClass({ mixins: [IntlMixin], render: function () {
return <FormattedNumber value={this.props.price} style="currency" currency="USD" /> } }); React.render( <App locales="fr-FR" price={1099.95} />, document.getElementById("container") ); Intl Mixin 1 099,95 $US
7.7k 150+ React Intl min + gz languages English as
default
None
CLDR ICU JS Runtimes (Intl.*) Format.js Core Format.js Integrations
Intl.MessageFormat Intl.RelativeFormat Future Intl Built-ins?
Questions? formatjs.io @ericf - Yahoo ReactConf