Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional "lookupHeader" to replace default header #179

Closed
Dominic-Preap opened this issue Apr 12, 2019 · 4 comments
Closed

Add optional "lookupHeader" to replace default header #179

Dominic-Preap opened this issue Apr 12, 2019 · 4 comments

Comments

@Dominic-Preap
Copy link
Contributor

Can we have optional "lookupHeader" to replace default header "Accept-Language"?

i18next
      .use(FilesystemBackend)
      .use(i18nextMiddleware.LanguageDetector)
      .init({
        detection: {
          order: ['header', 'querystring'],
          lookupQuerystring: 'lng',
          lookupHeader: 'x-language'
        },       
      });
@jamuhl
Copy link
Member

jamuhl commented Apr 12, 2019

feel free to provide a PR taking value from options: https://github.com/i18next/i18next-express-middleware/blob/master/src/languageLookups/header.js#L12 and default to the "Accept-Language" if not set

@Dominic-Preap
Copy link
Contributor Author

@jamuhl would you be able to review my PR?

@Dominic-Preap
Copy link
Contributor Author

@jamuhl Would you mind update this option in README.md? Thanks.

@jamuhl
Copy link
Member

jamuhl commented Apr 23, 2019

@Dominic-Preap was added to readme - thank you for the reminder...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants