Closed codechennerator closed 3 years ago
The module defaults to the first language of the app languages rather than en.
var acceptLanguage = require('accept-language'); acceptLanguage.languages(['cs', 'de', 'en']); console.log(acceptLanguage.get('id')); // cs
I can see that is actually the expected behavior here: https://github.com/tinganho/node-accept-language/blob/master/Source/AcceptLanguage.ts#L65
So maybe this is a feature request, but I would expect to be able to pass all of the languages regardless of order. I would expect to be able to set my default language by myself.
I think the current API design is nice. First is expected to be the default.
The module defaults to the first language of the app languages rather than en.
I can see that is actually the expected behavior here: https://github.com/tinganho/node-accept-language/blob/master/Source/AcceptLanguage.ts#L65
So maybe this is a feature request, but I would expect to be able to pass all of the languages regardless of order. I would expect to be able to set my default language by myself.