vizo / angular-ui-router-i18n Goto Github PK
View Code? Open in Web Editor NEWI18nUrlMatcherFactory for Angular UI Router
License: MIT License
I18nUrlMatcherFactory for Angular UI Router
License: MIT License
Hi!
What if we only need to update the url?
Is ui-router-i18n supposed to work with $state.go($state.$current.name, {locale:new_locale}, {notify:false, reload:false}); ??
Explanation (To whom it may concern):
Say, $rootScope.locale gets changed upon $stateParams.locale watch, and if $rootScope.locale changes to new value, trigger a routerTranslation. Now, with normal :urlParams I am able to translate them from my own logic, however we cannot have 2 states with the same number of urlparams (say /:x1/:x2 ) it will only present the first provided state with those 2 urls.
After changing to this ui-router-i18n, I thought about mixing both concepts (ui-router-i18n with my :urlParams translation based by keys if they are available). It works fine, however, changing between languages triggers a reload, even if I try $state.go($state.$current.name, newParams, {notify:false, reload:false});
So, since most of us would use 'angular translate' it seams normal that we only need to replace the url, save it to history and end of story. Of course, landing on locale specific URL should be handled by ui-router-i18n, and that's fine, because I triger my routerTranslate() by translation event only.
Thanks in advance
Hi,
I'm writing angular app with ui-router & angular-ui-router-i18n.
When I'm going between different states everything runs well, but if i'm on a state and I'm trying go to the same state but with different parameter I ends up with this error -> http://prntscr.com/7l2c5e
http://www.whiteisbrightblack.cz/swnmoravia/cs/kategorie/combined
http://prntscr.com/7l2pa5
I tried use only ui-router also with ui-router-extras but its the same...
Thank you for reply and have a nice day.
M.D.
Hi there. Awesome provider ๐
It's working great when I use ng-href="{{$state.href('public.about', {locale: $stateParams.locale})}}" in a link, but once I try to use ui-sref="public.about({locale: $stateParams.locale})" the link just doesn't functions...
Have you seen this behavior?
Thanks in advance
url: $urlMatcher.compile
en: '/'
fr: '/:locale'
Without locale prefix no view is being loaded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.