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
4.9k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.7k
Navigation in a hybrid app
hotchemi
3
1.2k
PermissionsDispatcher × Kotlin
hotchemi
0
2.7k
kotlin compiler plugin
hotchemi
1
660
Rx and Preferences
hotchemi
2
140
Introducing PermissionsDispatcher
hotchemi
1
130
khronos
hotchemi
4
1.8k
Other Decks in Programming
See All in Programming
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
150
マイグレーションコード自作して File-Based Routing に自動移行!! ~250 ページの歴史的経緯を添えて~
cut0
1
260
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
460
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
580
デザインシステムとコンポーネント指向によるフロントエンド開発プロセスの革新 / Innovation in Frontend Development Processes through Design Systems and Component-Oriented Architecture
nrslib
8
5.3k
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
110
Prompt Cachingは本当に効果的なのか検証してみた.pdf
ttnyt8701
0
530
Go1.23で入った errorsパッケージの小さなアプデ
kuro_kurorrr
2
330
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1k
労務ドメインを快適に開発する方法 / How to Comfortably Develop in the Labor Domain
yuki21
1
250
Prolog入門
qnighy
4
990
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
Featured
See All Featured
Docker and Python
trallard
39
3k
Documentation Writing (for coders)
carmenintech
65
4.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
326
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
30
2.3k
Gamification - CAS2011
davidbonilla
79
4.9k
Optimizing for Happiness
mojombo
375
69k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Fireside Chat
paigeccino
31
2.9k
Writing Fast Ruby
sferik
623
60k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
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!