Joined December 2013
·
Posted to
Easy i18n with language prefix and language-related route in Laravel 4
over 1 year
ago
Great pro tip, but how do you dynamically change language on website from /en to just / and backward while keeping the user on the same page?
Found the solution: https://coderwall.com/p/txyl3g
Achievements
168 Karma
8,064 Total ProTip Views
Nephila Komaci
Have at least one original repos where PHP is the dominant language
Forked
Have a project valued enough to be forked by someone else
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Raven
Have at least one original repo where some form of shell script is the dominant language
Cub
Have at least one original jQuery or Prototype open source repo
Charity
Fork and commit to someone's open source project in need
Np, I have found a bug in my code, but that is not it.
By Google suggestions you should have only one URL for specific content and prefix that with a language tag, so I keep all of my routes in english and just change the language tag.
In that way if the "user" wants to see the same page on a different language he does not need to know the
slug
in the specific language, but only append the desired language to theslug
.This is the way I prefer to keep my URL schema for better SEO.