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
1.2k
2
Share
Type-Safe i18n on RN
@hotchemi
June 22, 2018
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
290
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.5k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
8.2k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.3k
kotlin compiler plugin
hotchemi
1
800
Rx and Preferences
hotchemi
2
170
Introducing PermissionsDispatcher
hotchemi
1
170
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
110
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
140
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
150
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Swift Concurrency Type System
inamiy
0
530
t *testing.T は どこからやってくるの?
otakakot
1
680
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.6k
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.4k
実践CRDT
tamadeveloper
0
570
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
Agentic Elixir
whatyouhide
0
300
第3木曜LT会 #28
tinykitten
PRO
0
110
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
480
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
140
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
99
The Limits of Empathy - UXLibs8
cassininazir
1
310
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Mind Mapping
helmedeiros
PRO
1
160
The browser strikes back
jonoalderson
0
980
We Are The Robots
honzajavorek
0
220
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
200
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
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!