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
230
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.1k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.8k
Navigation in a hybrid app
hotchemi
3
1.2k
PermissionsDispatcher × Kotlin
hotchemi
0
2.9k
kotlin compiler plugin
hotchemi
1
700
Rx and Preferences
hotchemi
2
140
Introducing PermissionsDispatcher
hotchemi
1
140
khronos
hotchemi
4
1.9k
Other Decks in Programming
See All in Programming
Open source software: how to live long and go far
gaelvaroquaux
0
630
技術を根付かせる / How to make technology take root
kubode
1
250
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
0
130
もう僕は OpenAPI を書きたくない
sgash708
5
1.6k
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
ソフトウェアエンジニアの成長
masuda220
PRO
10
1.1k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Amazon Bedrock Multi Agentsを試してきた
tm2
1
290
Ruby on cygwin 2025-02
fd0
0
140
WebDriver BiDiとは何なのか
yotahada3
1
140
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
120
sappoRo.R #12 初心者セッション
kosugitti
0
250
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Typedesign – Prime Four
hannesfritz
40
2.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
A Tale of Four Properties
chriscoyier
158
23k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
What's in a price? How to price your products and services
michaelherold
244
12k
Agile that works and the tools we love
rasmusluckow
328
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
Done Done
chrislema
182
16k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
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!