funktionswerk / hapi-i18n

Translation module for hapi based on mashpie's i18n module
MIT License
39 stars 22 forks source link

accept-language : fa-IR not working #15

Closed jahangirahmad closed 7 years ago

jahangirahmad commented 7 years ago

I send accept-language "fa-IR" to hapi-js api. here hapi-js plugin options:

{
    register: i18n,
    options : {
      locales            : ['en', 'fa-IR'],
      directory          : __dirname + '/locales',
      languageHeaderField: 'accept-language'
    }
 }

This code does not detect locale, and set undefined in request.locale. but if if configure locales :['en', 'fa-ir'], it works. what should i do??

kaywolter commented 7 years ago

If it works: Configure the locales array with 'fa-ir'. Or is there a problem with that solution?

jahangirahmad commented 7 years ago

it's ok that use 'fa-ir' in my configuration file. But somewhere else (much) i used fa-IR in codes and database