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
1.3k
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.3k
Navigation in a hybrid app
hotchemi
3
1.4k
PermissionsDispatcher × Kotlin
hotchemi
0
3.4k
kotlin compiler plugin
hotchemi
1
830
Rx and Preferences
hotchemi
2
190
Introducing PermissionsDispatcher
hotchemi
1
190
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
Cloudflare is Agents
chimame
0
180
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
450
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
570
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
業務時間外もAIに働いてもらう話
colorful12
2
8.8k
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
Press start. Python's next generation.
willingc
PRO
3
260
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
290
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
730
Flow は今どうなっているか
mizdra
PRO
0
760
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
430
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
670
Featured
See All Featured
Bash Introduction
62gerente
615
220k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
Done Done
chrislema
186
16k
Paper Plane
katiecoart
PRO
2
53k
Deep Space Network (abreviated)
tonyrice
0
270
First, design no harm
axbom
PRO
2
1.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
Building Adaptive Systems
keathley
44
3.2k
New Earth Scene 8
popppiees
3
2.5k
Side Projects
sachag
455
43k
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!