Chapter Three: Language switcher for a multilingual Drupal 8 site

Recently one of our clients asked us to come up with a better language detection and redirection solution for their multilingual Drupal 8 site. Most out of the box solutions do not provide great user experience and IP based detection do not always work as expected. Browser based redirection also not an ideal option since at some point a visitor might want to manually choose wich language they want to see.

Having this issue in hand I started looking into possible solutions, I looked at number of multilingual Drupal and non-Drupal sites and couldn’t find anything that would work for our client. I thought what if we ask a visitor what to do by showing them a box with browser detected langauge. This is just as Chrome’s transaltion prompt that asks you if you’d like to translate the site. The prompt that is very simple and not as annyoing as some auto redirect solutions.