In what URL segment do you have language? /en/admin/dashboard or /admin/en/dashboard? [closed]

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…

EDIT: I am also using two lists of avalible languages to determine what languages are avalible for app/backend and for frontend (if the app is something like CMS). Eg. web can be only in english but app (cms) can be in czech, english, italian…

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.

4

For your developer-facing API, you should obey the Accept-Language header for the reason CodeCaster mentioned in the comments:

Translations are different representations of the same resource, so the resource identifier should remain the same.

However, for UI (i.e. anything where the user-agent is a web browser) using Accept-Language to decide which language to render the page in is probably a bad idea, since it is effectively unchangeable (unless you’re in the 0.001% of users who knows how) and may not reflect your users’ actual language preference anyway. Using Accept-Language to select the default language a user sees is a nice idea, but even Google recommends that you keep the content for each language on separate URLs.

As to your actual question: Where in the URL should the language fragment go? Well… It doesn’t really matter. There are no strict rules for this. It will largely depend on what is easiest for you to implement in your chosen framework.

Here is some additional reading:

  • How should I structure my URLs for both SEO and localization? (Webmasters.SE)
  • Working with multilingual websites (Google Webmaster Central blog)

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

In what URL segment do you have language? /en/admin/dashboard or /admin/en/dashboard? [closed]

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…

EDIT: I am also using two lists of avalible languages to determine what languages are avalible for app/backend and for frontend (if the app is something like CMS). Eg. web can be only in english but app (cms) can be in czech, english, italian…

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.

4

For your developer-facing API, you should obey the Accept-Language header for the reason CodeCaster mentioned in the comments:

Translations are different representations of the same resource, so the resource identifier should remain the same.

However, for UI (i.e. anything where the user-agent is a web browser) using Accept-Language to decide which language to render the page in is probably a bad idea, since it is effectively unchangeable (unless you’re in the 0.001% of users who knows how) and may not reflect your users’ actual language preference anyway. Using Accept-Language to select the default language a user sees is a nice idea, but even Google recommends that you keep the content for each language on separate URLs.

As to your actual question: Where in the URL should the language fragment go? Well… It doesn’t really matter. There are no strict rules for this. It will largely depend on what is easiest for you to implement in your chosen framework.

Here is some additional reading:

  • How should I structure my URLs for both SEO and localization? (Webmasters.SE)
  • Working with multilingual websites (Google Webmaster Central blog)

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật