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
140
Introducing PermissionsDispatcher
hotchemi
1
140
khronos
hotchemi
4
1.9k
Other Decks in Programming
See All in Programming
Open source software: how to live long and go far
gaelvaroquaux
0
630
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
140
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
130
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
4.3k
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
270
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.4k
技術を根付かせる / How to make technology take root
kubode
1
250
Spring gRPC について / About Spring gRPC
mackey0225
0
220
Grafana Cloudとソラカメ
devoc
0
170
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
380
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
190
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Building Applications with DynamoDB
mza
93
6.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
How to Ace a Technical Interview
jacobian
276
23k
What's in a price? How to price your products and services
michaelherold
244
12k
4 Signs Your Business is Dying
shpigford
182
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing for Performance
lara
604
68k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
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!