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
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
62
Drum 'n' JS
meeroslav
0
79
Monorepo demystified: Breaking the myth
meeroslav
0
70
Making the Argument for Monorepos
meeroslav
0
59
Scaling Vendure with Nx
meeroslav
0
190
Don't let compilation set the length of your Glühwein break
meeroslav
0
100
Vanquishing deployment dragons with Nx wizardry
meeroslav
0
260
Don't let compilation set the length of your coffee break
meeroslav
0
150
The other JavaScript performance (no one is talking about)
meeroslav
0
310
Other Decks in Programming
See All in Programming
今さら聞けない .NET CLI
htkym
0
200
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
250
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1.1k
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
200
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
6.6k
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.7k
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
220
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
340
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
500
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
リアルな遅延を測る仕様
kota_yata
1
120
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
BBQ
matthewcrist
89
10k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
400
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
440
Statistics for Hackers
jakevdp
799
230k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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