Skip to content

Locale Selector Middleware #39

@testinfected

Description

@testinfected

A more capable i18n middleware than our current locale negotiation middleware.

On an incoming request, it first tries to detect the locale value from the URI, then from a locale cookie, then from Accept-Language header, and finally falls back to the default platform locale.

It will redirect the user to the proper locale URI or, set the locale cookie to the detected locale and add a locale attribute to the request. It will also modify the path info to strip the locale prefix from the path. It should only redirect on head and get requests, not post, put or delete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions