strip browser locale priority before comparing

could be worth moving browser detect inside elseif line 162 to avoid unnecessary checks.

could also be worth (as i always do in my setups) refactoring error handler and language detection to their own classes and thus having a cleaner index.

kind regards