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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
@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.2k
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
180
Introducing PermissionsDispatcher
hotchemi
1
180
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
The NotImplementedError Problem in Ruby
koic
1
780
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
ふつうのFeature Flag実践入門
irof
7
3.9k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
250
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
4
910
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
120
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.6k
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.5k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.3k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
How to build a perfect <img>
jonoalderson
1
5.6k
We Are The Robots
honzajavorek
0
250
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Amusing Abliteration
ianozsvald
1
200
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Un-Boring Meetings
codingconduct
0
310
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
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!