Closed Bug 1083531 Opened 8 years ago Closed 8 years ago

Missing header on localized events listing

Categories

(www.mozilla.org :: Bedrock, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: Nukeador, Assigned: flod)

Details

(Whiteboard: [kb=1544968] )

Attachments

(1 file, 2 obsolete files)

dev and stage are fine and I don't have the bug locally either, I am investigating 
https://www.allizom.org/fr/contribute/events/
https://www.dev-allizom.org/fr/contribute/events/
{% if l10n_has_tag('contribute_2015', 'mozorg/contribute') or settings.DEV %}

Localized pages are not live yet as we had to deacticate them because QA disn't have time to test the sign up process per locale yet. We don't have a simple way to not activate this sub-page as it depends on the contribute page existing and it *does* exist in its previous form for these locales. The header will show up once the locale is activated for real with the new design and workflow.

So this is a indeed a bug but working around it will probably take more time and ressources than it takes to QA to test locales and then l10n-drivers to activate the page, marking as WONTFIX for this reason.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Reopening because this is actually quite bad, mostly because we reach that page from the new home, and the list of locales with the new home is much larger than the list of locales that will ever have a contribute page with tag.

Also, if I open a locale without contribute page, I get redirected to my locale instead of en-US
e.g. try to open https://www.mozilla.org/ach/contribute/events/
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
https://github.com/mozilla/bedrock/blob/master/bedrock/mozorg/templates/mozorg/contribute/events.html#L7

We could change this line from
> {% add_lang_files "mozorg/contribute" %}

to
> {% add_lang_files "mozorg/events" "mozorg/contribute" %}

And then create a mozorg/events.lang file with just the active tag when locale has the new template enabled. 

Cons: 
* Page keeps asking if I want to load the "Italian" version of the page and then reloads en-US if I choose yes (not sure why it doesn't happen on the current page, maybe tabzilla doesn't know where to show the message?)
* We need to manually manage this, and then clean up when we decide to remove the old template.

I hope there are better solutions, but I can't think of any.
Whiteboard: [kb=1544968]
If I understand this right I might have a simple (if a little hacky) solution that should work, and does not involve doing any lang-file-fu.

How about we add a little 'override' variable to the conditional:

{% if l10n_has_tag('contribute_2015', 'mozorg/contribute') or override == True or settings.DEV %}

Then we can force the header/footer to always show on contribute/events by doing:

{% set override = True %}

Maybe I am missing something here, so please correct me if there are still issues I am not yet quite understanding.
I confirm that adding a variable in contribute/events, and then changing all l10n_has_tag calls in contribute-base.html works.

We'll load some English strings for incomplete locales, but that's definitely better than what we have.
Assignee: nobody → agibson
Status: REOPENED → ASSIGNED
Attached file GitHub pull request (obsolete) —
This isn't just the events page, the same thing happens on /contribute/stories/ and, worse, on /contribute/signup/. If we force the new contribute header to appear on the events page, it includes links to these other pages as well.

As I understand it, we need to explicitly NOT allow some locales to reach the new signup form until we can handle submissions in their language. So how are locales being activated for the new contribute pages if not via l10n tag? 

If I visit https://www.mozilla.org/es-ES/contribute/ I get the old page, even though everything in the templates treats that locale as complete based on the presence of the 'contribute_2015' tag. I think we need similar logic on all the other new contribute pages as well, and something on the signup page that forcibly redirects them away from that form.

And because we link to events from the home page, which as we know is available and many more locales, maybe we just need an alternative events page for those locales that are blocked from /contribute? It could use the old base template and just show the same table.
We can also change the link on the homepage to point to the Reps calendar.  That is probably my first choice.

Let's change it to point here:  https://reps.mozilla.org/events
(In reply to Craig Cook (:craigcook) from comment #8)
> This isn't just the events page, the same thing happens on
> /contribute/stories/ and, worse, on /contribute/signup/. If we force the new
> contribute header to appear on the events page, it includes links to these
> other pages as well.

/contribute/stories is fixed as part of the current PR, by adding the same variable to base-stories.html
But you're right about contribute/signup.

> As I understand it, we need to explicitly NOT allow some locales to reach
> the new signup form until we can handle submissions in their language. So
> how are locales being activated for the new contribute pages if not via l10n
> tag? 

They read the active status, since the page is active but is supposed to use the old template, so they don't redirect to en-US. Then they don't find the contribute_2015 tag, and fail to load the complete template.

> If I visit https://www.mozilla.org/es-ES/contribute/ I get the old page,
> even though everything in the templates treats that locale as complete based
> on the presence of the 'contribute_2015' tag.

No locale has the tag on production, since no locale has been enabled on the back-end. So they all redirect to the old template. The problem is when you come from the home page to /contribute/events

Note: I've just received an update that we won't have any of those localized pages enabled before November 10 :-\
(In reply to Jennifer Bertsch [:jbertsch] from comment #9)
> Let's change it to point here:  https://reps.mozilla.org/events

At this point this definitely makes sense. 

Given the amount of time we have ahead, we could also think about reorganizing the lang files for the new contribute page (contribute, events, stories), and fix this issue.
So maybe we can show localized events and stories pages, and the "why volunteer" link still leads to the old page (a drastic change in design and the navbar goes away, but it works)... then all we really need is to not show the "get involved" link in the navbar for locales that shouldn't get the signup page. We might still need some hard redirect on /contribute/signup/ in case people link directly to it in a locale that shouldn't get the new form. We could bounce them to the old page.

I agree we should do the short-term fix and just link to reps from the home page until we can fix all this properly.
As discussed over IRC, this is not worth a Friday push to prod.

I'll try to think about an alternative solution for this, so that we keep loading the old contribute page for all active locales, and fallback to en-US for the others. Eventually we can change the home page URL on Monday.
Here's an alternative proposal that should work and implies a bit of .lang files moving on our side.

The old template (not contribute-old.html) uses contribute/mozorg.lang, which is file that currently holds all the strings.

This is the logic of this PR.

index.html
Still uses contribute/mozorg.lang as langfile reference.
If not active, redirects to en-US.
If active: if there's a contribute_2015 tag it loads the new template, if not loads contribute-old.html

All the new templates (events, stories, signup) uses two new lang file
mozorg/contribute/index.lang
mozorg/contribute/stories.lang

So these are the possible scenarios.

Locale with old template: mozorg/contribute.lang is active and no tag, all other files are not active. It will load the old template for /contribute, all subpages redirect to en-US.

Locale with new template: all 3 lang files will be active, mozorg/contribute.lang will have the contribute_2015 tag. It will load the new template and all localized subpages.

This also simplifies the cleanup process when we remove the old template, we just need to remember to remove references to mozorg/contribute.lang

Thoughts? I tested it locally and it seems to work as expected.

Since the localized versions won't be online for several weeks, we have time to move .lang files around without many risks.
Attached file GitHub pull request (obsolete) —
Created an additional PR to Flod's which links to /contribute/events/ for en-US only on the homepage. All other locales will link to https://reps.mozilla.org/events until this issue is resolved.
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/73a4d5597aaed9acd41f2e70b2dcc8f228679225
Bug 1083531 - Reorganize lang file for Get Involved pages

https://github.com/mozilla/bedrock/commit/63d24a1b0273cf7f104a3c148d9e789ca8680224
Merge pull request #2390 from flodolo/fix_contribute

Bug 1083531 - Reorganize lang file for Get Involved pages
Assignee: agibson → francesco.lodolo
Both /contribute/events and /contribute/stories now redirect to en-US, while /contribute is localized with the old template.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Attachment #8506775 - Attachment is obsolete: true
Attachment #8507731 - Attachment is obsolete: true
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.