simple javascript to detect browser using java utils

Java
//detect the language preference of the user's browser
var userLanguage = window.navigator.userLanguage || window.navigator.language;
Source

Also in Java: