JLanguageHelper::detectLanguage

Tries to detect the language.