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.4k
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
モダンOBSプラグイン開発
umireon
0
190
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
430
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.7k
安いハードウェアでVulkan
fadis
1
870
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
190
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
160
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
340
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
210
へんな働き方
yusukebe
6
2.9k
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
160
Scaling GitHub
holman
464
140k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
110
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Writing Fast Ruby
sferik
630
63k
Done Done
chrislema
186
16k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Limits of Empathy - UXLibs8
cassininazir
1
280
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!