Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Programming
2
840
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
210
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
4.2k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
6.9k
Navigation in a hybrid app
hotchemi
3
980
PermissionsDispatcher × Kotlin
hotchemi
0
1.9k
kotlin compiler plugin
hotchemi
1
520
Rx and Preferences
hotchemi
2
130
Introducing PermissionsDispatcher
hotchemi
1
110
khronos
hotchemi
4
1.6k
Other Decks in Programming
See All in Programming
「混ぜるな危険」を推進する設計
minodriven
6
1.7k
LINE Messaging APIの概要 - LINE API総復習シリーズ
uezo
1
180
Let's keep Commodore 64 alive for the next 40 years
mehowte
1
110
heyにおけるCI/CDの現状と課題
fufuhu
3
560
Cybozu GoogleI/O 2022 LT会 - Input for all screens
jaewgwon
0
330
Get Ready for Jakarta EE 10
ivargrimstad
0
2.3k
NEWT.net: Frontend Technology Selection
xpromx
0
250
Baseline Profilesでアプリのパフォーマンスを向上させる / Improve app performance with Baseline Profiles
numeroanddev
0
250
Chart実装が楽になりました。
keisukeyamagishi
0
120
Jetpack Compose, 어디까지 알고 있을까?
jisungbin
0
120
IE Graduation (IE の功績を讃える)
jxck
20
12k
A Philosophy of Software Design 後半
yosuke_furukawa
PRO
10
2.8k
Featured
See All Featured
KATA
mclloyd
7
8.7k
Building Applications with DynamoDB
mza
83
4.7k
The Art of Programming - Codeland 2020
erikaheidi
32
11k
Product Roadmaps are Hard
iamctodd
34
6.5k
In The Pink: A Labor of Love
frogandcode
131
21k
Statistics for Hackers
jakevdp
781
210k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_i
23
15k
The Power of CSS Pseudo Elements
geoffreycrofte
47
3.9k
Testing 201, or: Great Expectations
jmmastey
21
5.4k
The Invisible Customer
myddelton
110
11k
Side Projects
sachag
450
37k
Thoughts on Productivity
jonyablonski
43
2.3k
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!