Improve redirection script

Uses only the language part of the provided language/region code,
except for 'zh_CN' and 'zh_TW'.