feat: support header lang from localeAlias (#27)

This commit is contained in:
Tao Xu
2017-04-27 16:04:15 +08:00
committed by fengmk2
parent 6857227777
commit dddb4c0c2e
2 changed files with 28 additions and 1 deletions

View File

@@ -141,7 +141,7 @@ module.exports = function (app, options) {
if (languages.length > 0) {
for (let i = 0; i < languages.length; i++) {
const lang = formatLocale(languages[i]);
if (resources[lang]) {
if (resources[lang] || localeAlias[lang]) {
locale = lang;
break;
}