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
2
1.1k
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
250
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.2k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.9k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.1k
kotlin compiler plugin
hotchemi
1
740
Rx and Preferences
hotchemi
2
150
Introducing PermissionsDispatcher
hotchemi
1
150
khronos
hotchemi
4
1.9k
Other Decks in Programming
See All in Programming
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.4k
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
Laravel Boost 超入門
fire_arlo
3
220
Reading Rails 1.0 Source Code
okuramasafumi
0
250
チームのテスト力を鍛える
goyoki
3
800
AIでLINEスタンプを作ってみた
eycjur
1
230
アセットのコンパイルについて
ojun9
0
130
楽して成果を出すためのセルフリソース管理
clipnote
0
180
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.4k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
print("Hello, World")
eddie
2
530
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Music & Morning Musume
bryan
46
6.8k
Making Projects Easy
brettharned
117
6.4k
Context Engineering - Making Every Token Count
addyosmani
3
58
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Building an army of robots
kneath
306
46k
For a Future-Friendly Web
brad_frost
180
9.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
The Language of Interfaces
destraynor
161
25k
Become a Pro
speakerdeck
PRO
29
5.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
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!