setting the language cookie when a user logs into the system with a language set,
remembering the language when opening the login page
setting the language based on the browser when no cookie can be found
using the language cookie on the server to determine which locale file to use

removed commented code