0

A site like Twitter or Google Search lets users adjust their language in the user settings. If a user is not logged in, the language is determined based on the accept-language header. The language is then applied to the lang attribute of the html tag.

However, the site does not incorporate the language into the pathname (e.g. /en/search).

In the Google Search docs Tell Google about localized versions of your page there's this paragraph:

Some example scenarios where indicating alternate pages is recommended:

If you keep the main content in a single language and translate only the template, such as the navigation and footer. Pages that feature user-generated content, like forums, typically do this.

I'd guess that sites like Twitter and Google Search fall into this category.

The page then goes on:

Localized versions of a page are only considered duplicates if the main content of the page remains untranslated.

I'm a bit unsure what this means in practice. So alternate pages should be indicated, but then again, there is no unique pathname for every language and also the main content remains untranslated. So how should alternate pages be indicated? For sites like Twitter and Google Search, I don't see any indication of alternate pages in the response HTML or headers.

Is it fine to determine the locale based on either a user setting or the accept-language header and to render a localized "shell" in response for these types of sites?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.