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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
@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
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
610
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
220
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
13
6.2k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
AI 輔助遺留系統現代化的經驗分享
jame2408
1
980
A2UI という光を覗いてみる
satohjohn
1
150
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.7k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
210
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
170
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Side Projects
sachag
455
43k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
Exploring anti-patterns in Rails
aemeredith
3
430
Making the Leap to Tech Lead
cromwellryan
135
9.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Mind Mapping
helmedeiros
PRO
1
260
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
330
The Curse of the Amulet
leimatthew05
2
13k
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!