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
230
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.1k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.8k
Navigation in a hybrid app
hotchemi
3
1.2k
PermissionsDispatcher × Kotlin
hotchemi
0
2.9k
kotlin compiler plugin
hotchemi
1
700
Rx and Preferences
hotchemi
2
150
Introducing PermissionsDispatcher
hotchemi
1
140
khronos
hotchemi
4
1.9k
Other Decks in Programming
See All in Programming
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
200
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
1
210
CloudNativePGを布教したい
nnaka2992
0
110
負債になりにくいCSSをデザイナとつくるには?
fsubal
10
2.6k
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
140
自力でTTSモデルを作った話
zgock999
0
100
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
40
16k
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
890
Datadog Workflow Automation で圧倒的価値提供
showwin
1
160
Open source software: how to live long and go far
gaelvaroquaux
0
660
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
920
Better Code Design in PHP
afilina
0
170
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
430
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Invisible Side of Design
smashingmag
299
50k
Optimizing for Happiness
mojombo
376
70k
The Cult of Friendly URLs
andyhume
78
6.2k
Navigating Team Friction
lara
183
15k
GitHub's CSS Performance
jonrohan
1030
460k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Adopting Sorbet at Scale
ufuk
74
9.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
How to Ace a Technical Interview
jacobian
276
23k
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!