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.2k
Type-Safe i18n on RN
@hotchemi
June 22, 2018
Tweet
Share
More Decks by @hotchemi
See All by @hotchemi
kompile-testing internal
hotchemi
0
280
The things we’ve learned from iOS×React Native hybrid development
hotchemi
2
5.4k
React Nativeを活用したアプリ開発体制/sapuri meetup
hotchemi
3
8.1k
Navigation in a hybrid app
hotchemi
3
1.3k
PermissionsDispatcher × Kotlin
hotchemi
0
3.3k
kotlin compiler plugin
hotchemi
1
790
Rx and Preferences
hotchemi
2
160
Introducing PermissionsDispatcher
hotchemi
1
170
khronos
hotchemi
4
2k
Other Decks in Programming
See All in Programming
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
1
400
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
330
NetBSD+Raspberry Piで 本物のPSGを鳴らすデモを OSC駆動の7日間で作った話 / OSC2026Osaka
tsutsui
1
120
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
1.9k
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
2
170
CSC307 Lecture 07
javiergs
PRO
1
560
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
300
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
450
atmaCup #23でAIコーディングを活用した話
ml_bear
4
650
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
210
Documentation Writing (for coders)
carmenintech
77
5.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
78
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
100
The browser strikes back
jonoalderson
0
720
Claude Code のすすめ
schroneko
67
210k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
610
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
270
Design in an AI World
tapps
0
150
Building an army of robots
kneath
306
46k
Unsuck your backbone
ammeep
671
58k
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!