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

Update prefer_cms decorator and remove_locale func #6275

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smithellis
Copy link
Contributor

  • prefer_cms will now check if WT page exists in the requested locale instead of just at base path
  • remove_locale now returns the path and the locale_code

Comment on lines 184 to 186
# Set the language code in the request and activate the translation
request.LANGUAGE_CODE = locale_code
translation.activate(locale_code)
Copy link
Contributor

@escattone escattone Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need these lines (and the corresponding translation.deactivate() below in the finally clause), since our LocaleMiddleware will take care of that before the request reaches the view function.

* `prefer_cms` will now check if WT page exists in the
requested locale instead of just at base path
* `remove_locale` now returns the path and the locale_code

Update - remove translation
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

Successfully merging this pull request may close these issues.

2 participants