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.2k
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
280
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.4k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
8.1k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.3k
kotlin compiler plugin
hotchemi
1
790
Rx and Preferences
hotchemi
2
160
Introducing PermissionsDispatcher
hotchemi
1
170
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
AI巻き込み型コードレビューのススメ
nealle
2
2.2k
株式会社 Sun terras カンパニーデック
sunterras
0
1.8k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
140
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
470
Gemini for developers
meteatamel
0
120
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
430
浮動小数の比較について
kishikawakatsumi
0
330
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
2
790
Python’s True Superpower
hynek
0
180
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
190
Package Management Learnings from Homebrew
mikemcquaid
0
270
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
330
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
210
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
180
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
310
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
Building Adaptive Systems
keathley
44
2.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
30 Presentation Tips
portentint
PRO
1
240
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
How GitHub (no longer) Works
holman
316
140k
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!