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
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: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
130
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
170
RTSPクライアントを自作してみた話
simotin13
0
440
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
270
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
160
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.1k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
610
Inside Stream API
skrb
1
620
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
Featured
See All Featured
Ethics towards AI in product and experience design
skipperchong
2
300
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Google's AI Overviews - The New Search
badams
0
1k
A better future with KSS
kneath
240
18k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Deep Space Network (abreviated)
tonyrice
0
160
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
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!