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
不幸な GC
chencmd
0
820
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
T3DD26: From RAGs to Riches
martinhelmich
0
120
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
100
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
370
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
230
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
220
typoなんかねぇよ
raspython3
0
610
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
430
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
40
25k
信頼性の目標を誰も求めてない
shubox
0
320
Featured
See All Featured
HDC tutorial
michielstock
2
820
Raft: Consensus for Rubyists
vanstee
141
7.7k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
220
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
500
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Product Roadmaps are Hard
iamctodd
55
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
560
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!