Added detection of env["SCRIPT_NAME"]

Have added the detection of env["SCRIPT_NAME"] so that the user locale
detection is only carried out on actual Ruby Rack Request.