3 ms·
Here's a simple way to detect the UI language (for glocalization): ask your visitor for their choice. It only takes a few seconds, and it's much more reliable.
by nreece 17y ago
Here's a simple way to detect the UI language (for glocalization): ask your visitor for their choice. It only takes a few seconds, and it's much more reliable.
When in doubt, ask, don't assume.
- deleted 17y ago[deleted]
- jsonscripter 17y agoOr assume a default language and then have a clear option to change to something else. That's the same number of clicks in the worst case, but less in the average case. If you use the user agent string in combination with geo-location (and maybe a few other factors such as Facebook API or twitter API heuristics), you could lower the number of wrong languages using a sort of learning algorithm too.
- jm4 17y agoI know from experience that there are a few issues with that too. First, how do you ask? One way is to prominently display links to the other languages. You could put them in the top right corner of every page. You'd be surprised at how many users can't figure this out. Ok, so maybe you give first time visitors some kind of popup, interstitial page or overlay thing asking what their preference is and save it for future use. So what language do you ask in? Besides, a very large majority of your users will be using one language- let's say English- so this is totally pointless for them. Imagine if Google or HN asked you for your language preference every time you cleared your cache. It gets annoying quickly and you could risk increasing your bounce rate. A better way is to use a combination of detection, asking and then prominently displaying alternate language links. Identify some markers that may suggest a user wants a language other than the primary one. User agent string, IP geolocation, referred from a search engine where they did a search in another language, etc. Ask those users what language they would prefer; don't bother the others. The alternate language links are still available to the ones that slip through the cracks. Best Buy does something like this on their site. Set your language preference to Spanish in your browser and visit the home page to see it in action.