Skip to content

Suggestion - automatic language switching #37

@hovi

Description

@hovi

Re using SOLID_I18N_USE_REDIRECTS and set_language redirect view.

Correct me if I am wrong, but set_language redirect view is used to switch language for cases when language is not part of url for example, because if so, changing to language-aware itself should be act of switching language. I see no reason using that view for unnecessary redirect since I have language-aware urls.

Anyway I was playing around with it and changed middleware to logic that it doesn't try to use redirects if it already finds LANGUAGE_SESSION_KEY in session + it also sets this variable at end of process_request.

Can make pull request, with complete example, but just checking if it makes sense.

Cheers, thanks for the code, been using it for months on production without SOLID_I18N_USE_REDIRECTS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions