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
Angular route localization
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Miroslav Jonaš
May 10, 2017
Programming
350
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Angular route localization
Miroslav Jonaš
May 10, 2017
More Decks by Miroslav Jonaš
See All by Miroslav Jonaš
The dark art of code optimization
meeroslav
0
55
Drum 'n' JS
meeroslav
0
75
Monorepo demystified: Breaking the myth
meeroslav
0
61
Making the Argument for Monorepos
meeroslav
0
50
Scaling Vendure with Nx
meeroslav
0
180
Don't let compilation set the length of your Glühwein break
meeroslav
0
100
Vanquishing deployment dragons with Nx wizardry
meeroslav
0
250
Don't let compilation set the length of your coffee break
meeroslav
0
140
The other JavaScript performance (no one is talking about)
meeroslav
0
300
Other Decks in Programming
See All in Programming
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
290
OSもどきOS
arkw
0
580
Oxlintのカスタムルールの現況
syumai
6
1.1k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.9k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
New "Type" system on PicoRuby
pocke
1
990
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.4k
さぁV100、メモリをお食べ・・・
nilpe
0
150
dRuby over BLE
makicamel
2
380
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
440
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
sira's awesome portfolio website redesign presentation
elsirapls
0
280
RailsConf 2023
tenderlove
30
1.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
260
Making Projects Easy
brettharned
120
6.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
330
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Transcript
ANGULAR ROUTE LOCALIZATION ANGULAR MEETUP / APRIL 2017
ANGULAR ROUTE LOCALIZATION WHAT IS IT? ▸ Route localization ▸
Angular package ▸ Built for version 2+ ▸ Typescript ▸ v0.7.0
ANGULAR ROUTE LOCALIZATION WHY WOULD YOU CARE? www.site.com?page=98cf9c41-00fe-4f39-a813-91fc8a125770 www.site.com/users/4/account/profile www.site.com/watumiaji/4/akaunti/wasifu
‣ Do I support multiple languages? ‣ Do I plan to support multiple languages? ‣ Can I guarantee there will be no language support?
THE STORY BEHIND
ANGULAR ROUTE LOCALIZATION HOW DOES IT WORK? ▸ APP_INITIALIZER to
hijack the routes ▸ Route data property ▸ [routerLink] + Pipe ▸ Service for dynamic routes ▸ StartNavigation event ▸ ngx-translate (currently)
ANGULAR ROUTE LOCALIZATION [ { path: ‘home’, component: HomeComp },
{ path: ‘users’, children: [ { path: ‘’, component: UsersComp }, { path: ‘:id’, component: UserComp }, { path: ‘:id/account’, component: AccountComp} ] } ] original routes [ { path: ‘’, redirectTo: ‘en’, pathMatch: ‘full’ }, { path: ‘de’, children: [ { path: ‘startseite’, component: HomeComp }, { path: ‘benutzer’, children: [ { path: ‘’, component: UsersComp }, { path: ‘:id’, component: UserComp }, { path: ‘:id/bericht’, component: AccountComp} ] } ] } ] translated routes (*de)
ANGULAR ROUTE LOCALIZATION { “ROUTER.users”: “benutzer”, “ROUTER.profile”: “profil”, “ROUTER.account”: “bericht”
} + /users/4/account/profile = de/benutzer/4/bericht/profil i18n/de.json
ANGULAR ROUTE LOCALIZATION BUT NOT SO SIMPLE… ▸ AOT vs
Lazy loading ▸ No event after lazy load ▸ Router changes
TL;DEMO
ANGULAR ROUTE LOCALIZATION CURRENT STATE ▸ Lazy loading still not
there ▸ Tight coupling with ngx-translate ▸ Use it ▸ Find issues ▸ Help solve them
ANGULAR ROUTE LOCALIZATION ▸ npm install —save localize-router ▸ https://www.npmjs.com/package/localize-router
▸ https://github.com/Greentube/localize-router ▸ @meeroslav ▸ https://github.com/meeroslav
THANK YOU