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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.3k
Navigation in a hybrid app
hotchemi
3
1.4k
PermissionsDispatcher × Kotlin
hotchemi
0
3.4k
kotlin compiler plugin
hotchemi
1
820
Rx and Preferences
hotchemi
2
190
Introducing PermissionsDispatcher
hotchemi
1
190
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
in-process GraphQL のすすめ #ginzajs
izumin5210
0
130
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
190
Foundation Models frameworkで画像分析
ryodeveloper
1
620
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.6k
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
790
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
730
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
Cloudflare is Agents
chimame
0
170
Google Apps Script で Ruby を動かす
kawahara
0
240
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
React本体のコードリーディング
high_g_engineer
1
140
Featured
See All Featured
For a Future-Friendly Web
brad_frost
183
10k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
470
Designing for Performance
lara
611
70k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Darren the Foodie - Storyboard
khoart
PRO
3
3.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
290
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Color Theory Basics | Prateek | Gurzu
gurzu
0
420
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!