In what URL segment do you have language? /en/admin/dashboard or /admin/en/dashboard?
Posted
by
Shimmi
on Programmers
See other posts from Programmers
or by Shimmi
Published on 2013-11-13T15:50:57Z
Indexed on
2013/11/13
16:14 UTC
Read the original article
Hit count: 692
localization
|url
maybe you are thinking that this is another dump question about language in URL, but I hope it is not! I've red many articles on this, but non of them was dealing with "sections of site" (described bellow).
I am programming a new application platform in laravel/php and I am still not 100% convinced where to put language slug.
There are many places where you can put it - some of them are better some are worse:
- example.com/en/article
- en.example.com/article
- example.com/article?lang=en
My personal choice is to put language after the domain - so the first option in above list.
But what if you are in some special secion like admin or api? where do you put language then?
- example.com/en/admin/dashboard
- example.com/en/api/v1/user/login
or
- example.com/admin/en/dashboard
- example.com/api/v1/en/user/login
(in frontend it is left the same: example.com/en/some-article)
what do you preffer? what are cons and pros? One thing is using language in first segments is far more easier to programm than when it have some variants...
P.S. whould you recoment using only en, cs or do it in full power with cz-CZ, en-US ?
thanks for any thoughts!
J.
© Programmers or respective owner