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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
@hotchemi
June 22, 2018
Programming
2
1.2k
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
280
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.4k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
8.1k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.3k
kotlin compiler plugin
hotchemi
1
780
Rx and Preferences
hotchemi
2
160
Introducing PermissionsDispatcher
hotchemi
1
160
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
330
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
130
Raku Raku Notion 20260128
hareyakayuruyaka
0
310
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
710
Implementation Patterns
denyspoltorak
0
290
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
AI時代の認知負荷との向き合い方
optfit
0
160
高速開発のためのコード整理術
sutetotanuki
1
400
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Curse of the Amulet
leimatthew05
1
8.6k
It's Worth the Effort
3n
188
29k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
How to Talk to Developers About Accessibility
jct
2
130
The untapped power of vector embeddings
frankvandijk
1
1.6k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
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!