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.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.3k
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
190
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
どこまでゆるくて許されるのか
tk3fftk
0
500
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
520
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
140
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
170
yield再入門 #phpcon
o0h
PRO
0
480
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
190
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
240
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
380
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
140
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
470
Writing Fast Ruby
sferik
630
63k
For a Future-Friendly Web
brad_frost
183
10k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
A Tale of Four Properties
chriscoyier
163
24k
Accessibility Awareness
sabderemane
1
160
The World Runs on Bad Software
bkeepers
PRO
72
12k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
170
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
190
Building an army of robots
kneath
306
46k
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!