They seem to go against the advice
You may be tempted to store the chosen locale in a session or a cookie. Do not do so. The locale should be transparent and a part of the URL.
from the official Rails I18n guide
I tried seeing if they set a cookie for the locale, and it seems like they don't.
So how do they do it and why they chose not to use URLs for different languages, like http://github.com/en/foo, h开发者_如何学JAVAttp://github.com/fr/foo, etc. ?
It uses the _gh_sess cookie to store that information.
Multiple URLS are sometimes avoided because they create something looking a lot like duplicate content for search engines. This can deplete your Google Karma and lead to poor SEO performance.
精彩评论