lang.js is a simple library that help you with multilanguage sites.
Use this to view the main user language
navigator.lang
// Console returns your favourite language
Use this to check if the input language is the main language
navigator.islang("en")
// Console returns true if user use english
Use this for callback functions that require a specific user language
navigator.iflang("en", callback)
// For example, if user use english and callback returns true, the console returns true, too.
This library is useful only if you want to know user language, not user nationality: for example, you can't know if a user is American or British, you can only know if they speak English.
If you want test this library, click here.