Based on the successful A/B test, we'd like to push this update into production on the Wikipedia.org portal.
This ticket is to refactor the code from the test to make sure it's production ready.
The following is the description of what we're going to do:
This is a feature which detects the user's language and re-sorts the links around the globe on the Wikipedia portal in line with their preferred language settings. The user's preferred language will be displayed in the top left link.
If the user does not have as many language preferences as there are available links to display, fill the remainder links around the globe with the "top" links that are not in their language preferences.
If they do not have a header (lang pref file) or we cannot retrieve it, display the default experience.
If the user has a language preference that is not in English, we will take that primary preferred language and display the "The Free Encyclopedia" phrase below the Wikipedia wordmark in that preferred language.