Giter Club home page Giter Club logo

nginx_accept_language_module's People

Contributors

giom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginx_accept_language_module's Issues

2-letter code insufficient for locale

For some major languages, 2-letter code is inadequate/insufficient.

Consider the Chinese language, which has 2 scripts, simplified and traditional. Those would be described as 5-character locale code zh-cn, zh-sg (simplified) and zh-tw, zh-hk (traditional).

It would be nice if your module could work with 5-character locale codes and some kind of user-defined locale-to-locale mapping.

You can see an example of my method I wrote in PHP Language Detector.

Vary header

Does this module also have a way to add ", Accept-Language" to the Vary header -- or is there some good way to do this on nginx generally?

Scalability

On review I noticed this module is prone to poor scalability.

Scales roughly O(n*m) where n is the number of languages supplied in the header and m is the number of languages supported.

If m is sufficiently large this module will cease to perform well.

Add option for cookie checking [feature request]

A handy option, besides checking the accept language header, would be also to check an optional cookie value for a language code as well.

Maybe the following optional config statement:

accept_language_cookie <name of cookie to check>

And give the value of the cookie preference over the language order given in the accept language header.

This would allow the application to override the automagic language value (by setting a cookie), in case the uise would like to choose a language other than what their browser is set to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.