Closed Bug 1505825 Opened 6 years ago Closed 6 years ago

[Translate.Next] Language is not passed to the template in prod

Categories

(Webtools Graveyard :: Pontoon, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adrian, Assigned: adrian)

Details

Attachments

(2 files)

In production, we use `TemplateView.as_view` to generate the view that returns the translate template. However, before django 2, the generated view does not accept any context (nor extra_context), and thus passing the language as part of that simply does nothing. It leads to the translate page not being translated (it always shows en-US). 

We need to change the way we pass the locale to Translate.Next. I'm not sure yet what the solution will be, but it will likely by that the js code will make a query to the backend to get the user's preferred locale.
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/670eb75d05ba4012659682d6024fdd854c497378
Fix bug 1505825 - Rework language negotiation. (#1131)

This fixes passing the preferred locale of the user to the template for production. It also changes the language negotiation logic: now if the user has defined a preferred locale, they will be shown the UI in that locale, otherwise we use simple langneg in the client.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: