Comments (11)
It's a sensible request generally.
However, if you have only one locale, why use localize-router
in the first place?
from localize-router.
@thebarada Just checked the code quickly... There is a possibility to enable this functionality if only single locale is provided in the config.
However, you have to understand that at the moment this has low priority and would require some additional changes which are planned only for the future version (spoiler: fully configurable localize-router
).
from localize-router.
in my case, user can set up one or more langs in your profile
so, it is locales is dynamic
from localize-router.
Well you still need to support n
languages in this case, which means there should be multiple routes to the same page based on the language, right? :)
So even if your user has only set 1 locale, you support more than 1 locale so you need to prefix it nonetheless
from localize-router.
but if user set up only one language, I think it will be more correctly if url will still without lang prefix :)
from localize-router.
Okay, let's see it from the point of a route.
Let's say you have for example /en/my-profile
. In english it will stay the same, for german it would be /de/mein-profil
and in french it would be /fr/mon-profil
.
It does not matter if your user has only set French for example, as the other possibilities still can be used by other users.
Or could you give an example?
EDIT: Well it would be possible for you to omit the language itself if you define the routes manually.
{ path: 'my-profile', component: ProfileComponent },
{ path: 'mein-profil', component: ProfileComponent },
{ path: 'mon-profil', component: ProfileComponent },
In this case you wouldn't need localize-router
and would set the language probably based on the route or the browser or some other detection mechanism.
from localize-router.
Said user
, I did not mean person that use application
I've mean user who set up you own application (like CMS)
from localize-router.
Well, I can say that such functionality would most likely never be implemented because there are multiple unclear (and potentially breaking) scenarios:
- if user goes to
www.yoursite.com/person
which language should the application be rendered in if this word exists in both German and English language? - in order for application to apply translation and localization it has to load the correct translation file. If you provide only text e.g.
mon-profil
, we need to load all the languages to distinguish which one of them has this text (and then manually run route checking to see if it's even possible route) and then translate all the routes. All this while application is waiting in bootstrap loop. I can't even try to explain how (almost) impossible this is. Of course this only works in case scenario one does not happen - no link sharing would be possible, unless two users share the same language
- etc.
Just from the top of my head, I'd say that's quite a lot of good reasons to justify "annoyance" of language prefix.
from localize-router.
Beside of that, if you as the user (setting up the application) decide to have just one language, why using localize-router
? You decide the spectrum of languages so you should decide as well if the module is needed.
from localize-router.
@Chuvisco88 so, you suggest check number of languages before bootstrapping of application?
from localize-router.
@meeroslav ok, I've see you
if you'll include this functionality to future version - it will be great)
will waiting for update)
from localize-router.
Related Issues (20)
- localize-router not working as expected with Angular Universal: server-side rendering HOT 6
- Function traverseSnapshot not properly assembling the new translated route. HOT 11
- Localize router unable to pass data params on an empty path HOT 2
- Out of sync localize pipe HOT 1
- changeLanguage does not work for route with parameters HOT 6
- After language is switch, back button redirect into 404
- InitialNavigation enabled crashes Routing HOT 7
- Lazy loaded component is not bootstrapping HOT 4
- can't trigger window.load
- Angular 8 + IVy support HOT 1
- Can't make it, need tutorial. HOT 1
- Angular recognize only the default lang in SSR. HOT 4
- Angular 8 support HOT 6
- Extra slash translating root route
- LazyLoad Child Componenter onPage Refresh re-directs:Home Page HOT 1
- Unhandled promise rejection HOT 6
- Custom Cookies expiration
- Children routes issue lazy load module HOT 5
- Problem with Initial Navigation in RouterModule HOT 4
- LocalizeRouterModule.forRoot returns a ModuleWithProviders type without a generic type argument HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localize-router.