Language automatically selected

Good afternoon, I have a site that already have the language files (English and Portuguese Brazilian) and operating normally when the user selects your language by DropDownList, however would like the login screen and creating the login screen, the language was selected automatically based on the browser language (or other best).

What better way to do this?