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
Eric Ferraiuolo
January 28, 2015
Programming
490
2
Share
React.js & i18n
http://formatjs.io/
Eric Ferraiuolo
January 28, 2015
More Decks by Eric Ferraiuolo
See All by Eric Ferraiuolo
Node on the Road
ericf
1
130
Pure
ericf
7
990
YUI and The Future
ericf
2
760
YUI 3.10.0 — Go Fast
ericf
3
600
YUI, Open Source, and Community
ericf
0
470
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
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
230
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
AIエージェントで業務改善してみた
taku271
0
550
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
450
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
310
GoogleCloudとterraform完全に理解した
terisuke
1
170
AIを導入する前にやるべきこと
negima
2
310
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
710
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
300
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
140
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
書き換えて学ぶTemporal #fukts
pirosikick
1
300
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Documentation Writing (for coders)
carmenintech
77
5.3k
Making Projects Easy
brettharned
120
6.6k
How to build a perfect <img>
jonoalderson
1
5.4k
Being A Developer After 40
akosma
91
590k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
What's in a price? How to price your products and services
michaelherold
247
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Odyssey Design
rkendrick25
PRO
2
590
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