The amount of effort required to get as translate a website into multiple languages is to put it lightly - substantial in both development and translation time. Yet, on a lot of websites, some small details are overlooked and provide a bad experience for some of the users.
Select your selector wisely
It’s often convenient to add flags and call it a day. While this works for most countries, there are some edge-cases we have failed to consider.
United Kingdom, United States of America or Nigeria
English is a widely-spoken language. Even though it’s not the official language in the USA quite often English is denoted with the USA flag. In other cases, the flag of the United Kingdom is used. Slightly better because as the English language is official there. But does that mean you can also use the nigerian flag and would that be clear to your user-base?
What language does the Switzerland flag denote?
Another edge-case is the bank-center of the world - Switzerland. The official language there is German! And French! And Italian! Given that we could only imagine the confusion of swiss people when they see their flag on a language selector.
Tom-ah-to or Tom-ay-to
Spanish is the second most spoken language in the world. That, however, does not mean that if you put two random spanish speakers in a room they will easily understand each other. The reason is different dialects - European Spanish, Mexican Spanish, Argentinian Spanish, Colombia Spanish and more… They all have different meanings for the same words. Therefore, it’s important to also denote the dialect for the language. This is also relevant in British and American english.
Numbers in Arabic
Some languages have specifics. In Arabic, When counting one and two, you put the number after the noun; when counting from three to ten, you put the number before the noun. This means you need to be wary of the translation templates you are using, depending on the languages you will be targeting. Some libraries support these out of the box, others don’t. Be sure to make your decision wisely.
How can it be implemented properly
When it comes to flags, it’s usually better to omit them. It’s not always visually pleasing, but it’s also not misleading.
As for the dialects - there’s already a standardised list of language and dialects specified in ISO 639-1. The list is not exhaustive but covers a huge chunk of the population.