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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
@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.2k
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
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
390
高速開発のためのコード整理術
sutetotanuki
1
360
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
160
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
CSC307 Lecture 01
javiergs
PRO
0
680
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
1.9k
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
6.1k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.8k
CSC307 Lecture 06
javiergs
PRO
0
670
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
130
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
180
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
200
We Are The Robots
honzajavorek
0
150
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Site-Speed That Sticks
csswizardry
13
1k
Bash Introduction
62gerente
615
210k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Scaling GitHub
holman
464
140k
Making Projects Easy
brettharned
120
6.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
New Earth Scene 8
popppiees
1
1.5k
Unsuck your backbone
ammeep
671
58k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
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!