开发者

How does Github do localization?

开发者 https://www.devze.com 2023-02-25 13:51 出处:网络
They seem to go against the advice You may be tempted to store the chosen locale in a session or a cookie. Do

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消