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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
980
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
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
610
実践CRDT
tamadeveloper
0
590
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
280
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
150
CDK Deployのための ”反響定位”
watany
5
800
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
24
14k
Kingdom of the Machine
yui_knk
2
790
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
0
420
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
3
970
GoogleCloudとterraform完全に理解した
terisuke
1
140
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1k
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
4 Signs Your Business is Dying
shpigford
187
22k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
490
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Optimizing for Happiness
mojombo
378
71k
エンジニアに許された特別な時間の終わり
watany
106
240k
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Visualization
eitanlees
150
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
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