fix getLanguage in i18n.js

we need to normalize the language string before trying to match them
with available languages:

1. in lower case
2. replace '-' by '_'

ex. zh-TW => zh_tw, zh-CN => zh_cn