Fixed #21579 -- Made LocaleMiddleware respect script prefix.

Thanks buettgenbach at datacollect.com for the report and patch.