Skip to content

Instantly share code, notes, and snippets.

@tommorris
Last active April 3, 2016 17:33
Show Gist options
  • Save tommorris/01a0bd8a269308c3e3a051b112a6d5ff to your computer and use it in GitHub Desktop.
Save tommorris/01a0bd8a269308c3e3a051b112a6d5ff to your computer and use it in GitHub Desktop.
A bug report for GDS / GOV.UK over hreflangs on multilingual content

On GOV.UK, there are a number of pages with multilingual content, specificially in the Worldwide section. For instance, most pieces of content that you can find from the UK and Brazil section are available in both English and Portuguese. The same is true for most other countries: the material about the UK's relationship with France is mostly available in both English and French; the material on Germany is in both English and German.

To illustrate the issue, take this page:

British Embassy in Brasilia - GOV.UK

Here is its equivalent in Portuguese:

Embaixada Britânica Brasília - GOV.UK

What GOV.UK is doing right

  1. Providing multilingual content!
  2. Providing the content at broadly similar URLs - the Portuguese version is simply the English URL plus ".pt" - this is good, transparent URL design and is great.
  3. Placing links between the English and Portuguese version in a clear and obvious place on most documents.

What GOV.UK needs to improve on

  1. Marking the language of the documents appropriately. If you look at the HTML, the language setting of the document (the value of the lang attribute), it is always en, even if the document isn't in English.
  2. Not using the hreflang attribute to mark the language of the target page, nor using rel="alternate" to mark that alternate versions of the same page. Wikipedia articles use hreflang to link to equivalent articles in other languages.

hreflang (combined with rel="alternate") is used by Google and other search engines to see that multi-lingual versions of pages are available and to better surface content to people who search for content in a particular language.

Further reading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment