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
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
870
霧の中の代数的エフェクト
funnyycat
1
490
継続モナドとリアクティブプログラミング
yukikurage
3
700
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
今さら聞けない .NET CLI
htkym
0
180
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
350
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
240
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
140
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
10k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
BBQ
matthewcrist
89
10k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.7k
Speed Design
sergeychernyshev
33
2k
We Are The Robots
honzajavorek
0
290
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
400
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Making Projects Easy
brettharned
120
6.7k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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!