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
5k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
7.8k
Navigation in a hybrid app
hotchemi
3
1.2k
PermissionsDispatcher × Kotlin
hotchemi
0
2.9k
kotlin compiler plugin
hotchemi
1
690
Rx and Preferences
hotchemi
2
140
Introducing PermissionsDispatcher
hotchemi
1
130
khronos
hotchemi
4
1.8k
Other Decks in Programming
See All in Programming
Оптимизируем производительность блока Казначейство
lamodatech
0
960
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
310
テストコード書いてみませんか?
onopon
2
340
return文におけるstd::moveについて
onihusube
1
1.4k
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
140
rails newと同時に型を書く
aki19035vc
5
710
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
600
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
410
ASP.NET Core の OpenAPIサポート
h455h1
0
120
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
GraphQLとの向き合い方2022年版
quramy
44
13k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Bash Introduction
62gerente
610
210k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Producing Creativity
orderedlist
PRO
343
39k
A better future with KSS
kneath
238
17k
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!