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
Type-Safe i18n on RN
Search
@hotchemi
June 22, 2018
Programming
2
1.1k
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
250
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.1k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.9k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.1k
kotlin compiler plugin
hotchemi
1
730
Rx and Preferences
hotchemi
2
150
Introducing PermissionsDispatcher
hotchemi
1
150
khronos
hotchemi
4
1.9k
Other Decks in Programming
See All in Programming
Doma で目指す ORM 最適解
nakamura_to
1
170
External SecretsのさくらProvider初期実装を担当しています
logica0419
0
250
単体テストの始め方/作り方
toms74209200
0
320
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.1k
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
200
Passkeys for Java Developers
ynojima
2
740
TypeScript製IaCツールのAWS CDKが様々な言語で実装できる理由 ~他言語変換の仕組み~ / cdk-language-transformation
gotok365
7
400
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
130
【TSkaigi 2025】これは型破り?型安全? 真実はいつもひとつ!(じゃないかもしれない)TypeScript クイズ〜〜〜〜!!!!!
kimitashoichi
1
300
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
170
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
110
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.8k
Featured
See All Featured
Building an army of robots
kneath
306
45k
Into the Great Unknown - MozCon
thekraken
39
1.8k
Fireside Chat
paigeccino
37
3.5k
How GitHub (no longer) Works
holman
314
140k
Documentation Writing (for coders)
carmenintech
71
4.8k
The Cost Of JavaScript in 2023
addyosmani
49
8.3k
How to Ace a Technical Interview
jacobian
276
23k
Rails Girls Zürich Keynote
gr2m
94
13k
We Have a Design System, Now What?
morganepeng
52
7.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
Type-Safe i18n on RN Quipper Limited @hotchemi
7/19 Thu 19:30~22:00
react-native-i18n user?!
• It’s OK, but... • key name can be long
and nested • gotta move around definition and code • can’t detect an error in compile time • “missing [key name] translation”
None
• quipper/react-native-i18n-ts • paired with TypeScript • inspired by R.java
mechanism • strong IDE support • compile time check
Demo
• Under the hood • Generate d.ts file from definition
• with TypeScript compiler API
declare module "react-native-i18n" { var fallbacks: boolean; var translations: {
[keys: string]: any; }; function t(key: "common.cancel", opts: { value: any; }): string; function t(key: "common.ok"): string; } // for json loading declare module "*.json" { const value: any; export default value; }
• Installation • yarn add -D react-native-i18n-ts • set “model”
and “outputDir” in package.json • tweak filesGlob in tsconfig.json • execute “yarn i18n-ts” command
Enjoy!