Closed Bug 860875 Opened 11 years ago Closed 11 years ago

Offer the correct localized full installer based on an url param for the stub installer fallback page

Categories

(www.mozilla.org :: Pages & Content, defect, P2)

x86_64
Windows 7
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: robert.strong.bugs, Assigned: pmac)

References

Details

(Whiteboard: [stub+])

The locale being installed by the stub installer can be different than the detected locale. I'll add a lang param to specify the locale being installed to the url when opening the fallback page to make this possible.
Depends on: 860897
Robert:

What if you took the locale of the installer and used it in the absolute URL?

e.g.

https://www.mozilla.org/[installer locale]/firefox/installer-help/

Current, that page nor the download buttons are localized, but when that is done, the URL should force the localized version without any browser sniffing.
I am fine with that. If the page fallsback to en-US though it should still offer the localized installer.
(In reply to Robert Strong [:rstrong] (do not email) from comment #2)
> I am fine with that. If the page fallsback to en-US though it should still
> offer the localized installer.

If the fallback gets its lang preference from the URL, why would the en-US page present a non-en-US build?

If a french installer points people to www.mozilla.org/fr/firefox/installer-help/ we would show buttons pointing to the lang=fr build. Why would we would a link to www.mozilla.org/en-US/firefox/installer-help/ present a non-en-US build?
What I am saying is that in the case where a localized page is not available and it falls back to the en-US page due to there not being a localized page or whatever the full installer will need to be for the locale and not the en-US page.
Chris, is comment #4 possible using the https://www.mozilla.org/[installer locale]/firefox/installer-help/ url? Perhaps just precreate the pages for all locales using the en-US text so they never fallback to en-US?
Regarding comment #5
Flags: needinfo?(chrismore.bugzilla)
Chris, can I get the info requested in comment #5? Thanks!
rstrong: Sorry for the late response as I have been caught up in other issues. We don't normally precreate pages in other locales as that happens automatically when strings have been translated and the L10N team decides to launch a new localized page. Is the rationale for the precreate of the pages so that the button gives them the right locale even if the page is not translated yet? I believe that is what you are after.

pmac: Any suggestion on how to handle telling the buttons to use a specific language for a download? If the page is not translated, it will fall back to en-US and thus give the user an en-US full-installer build when they may have been trying to install es-ES.
Flags: needinfo?(chrismore.bugzilla) → needinfo?(pmac)
This is an issue. Even if we did manage to translate the page into a lot of languages, we'd probably never match the full range of languages Fx supports.

I'd suggest doing a combination of the two of these things. I'd be nice to send them to the page using the locale in the URL so that the page will appear in their language if available, but also include a query param for the installer language so that we're sure to present the correct build for download. You can't use "?lang=fr" for example because bedrock has a special meaning for the "lang" query param. I'd suggest "?installer_lang=fr" or something similar.
Flags: needinfo?(pmac)
So, how about the following url:
https://www.mozilla.org/[installer locale]/firefox/installer-help/?installer_lang=[installer locale]
(In reply to Chris More [:cmore] from comment #8)
> rstrong: Sorry for the late response as I have been caught up in other
> issues. We don't normally precreate pages in other locales as that happens
> automatically when strings have been translated and the L10N team decides to
> launch a new localized page. Is the rationale for the precreate of the pages
> so that the button gives them the right locale even if the page is not
> translated yet? I believe that is what you are after.
That's the goal. I think using the url in comment #10 will allow the stub installer to be updated while allowing the flexibility to add the capability to the fallback page if / when possible.
The actual url that would be used
https://www.mozilla.org/[AB_CD]/firefox/installer-help/?channel=[installer channel]&installer_lang=[AB_CD]

[installer channel] = release, beta, aurora, or nightly
[AB_CD] = the installer's locale (e.g. en-US, fr, etc.)
(In reply to Robert Strong [:rstrong] (do not email) from comment #12)
> The actual url that would be used
> https://www.mozilla.org/[AB_CD]/firefox/installer-help/?channel=[installer
> channel]&installer_lang=[AB_CD]
> 
> [installer channel] = release, beta, aurora, or nightly
> [AB_CD] = the installer's locale (e.g. en-US, fr, etc.)

rstrong: That seems right.

Pmac: Is this something that the buttons should be aware of regardless of what page they are generated on or should it be something we have to explicitly override on a per-page basis?
(In reply to Chris More [:cmore] from comment #13)
It could be either really. I can't think of another page we might want this on, but I could either do this in the view for the installer-help page (one-off), or in a middleware that would add it to the template context globally. I was thinking this would just be for that one page, but if you have use cases for others then we can just go ahead and make these query params globally useful for pages with download buttons.
(In reply to Robert Strong [:rstrong] (do not email) from comment #12)
Looks perfect. We technically wouldn't need the 'installer_lang' param for en-US since the page will always work in en-US, but send it anyway if it adds complexity to the installer to avoid it for just en-US.
(In reply to Paul McLanahan [:pmac] from comment #14)
> (In reply to Chris More [:cmore] from comment #13)
> It could be either really. I can't think of another page we might want this
> on, but I could either do this in the view for the installer-help page
> (one-off), or in a middleware that would add it to the template context
> globally. I was thinking this would just be for that one page, but if you
> have use cases for others then we can just go ahead and make these query
> params globally useful for pages with download buttons.

Is the one-off installer-help page the easiest? I don't want to add a lot of complexity for an exception page.
(In reply to Chris More [:cmore] from comment #16)

I think it will be easiest, yeah. So we can do this now and file a bug to make it more global for later, or even wait until we want/need it on another page to make it global.
(In reply to Paul McLanahan [:pmac] from comment #17)
> (In reply to Chris More [:cmore] from comment #16)
> 
> I think it will be easiest, yeah. So we can do this now and file a bug to
> make it more global for later, or even wait until we want/need it on another
> page to make it global.

Works for me. Don't need to add complexity without a current need. Do you have enough information to proceed?
Assignee: nobody → pmac
Priority: -- → P2
Since it will also tell us the channel, should we no longer show all three buttons on this page if we're given the channel?
(In reply to Paul McLanahan [:pmac] from comment #19)
> Since it will also tell us the channel, should we no longer show all three
> buttons on this page if we're given the channel?

Can the bedrock button app to all of the channels?
I've created this PR as my proposal:

https://github.com/mozilla/bedrock/pull/805

The language for the buttons works great. If the channel is specified and is one of the choices, then only one button on the right is shown, and is the large one with the logo. And the text for the sub title changes from:

    Please choose a download to continue.

to:

    Click the button on the right to continue.

This new text probably needs to be better, but you get the idea. Let me know what you think here or in the comments on the PR.
Any opinions on how this works or the text changes? Is there someone I should ping?
(In reply to Paul McLanahan [:pmac] from comment #22)
> Any opinions on how this works or the text changes? Is there someone I
> should ping?

I think "Click the button on the right to continue." to continue is good enough for now. The page should not get a massive amount of traffic or the stub installer has some issues.
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/bd6f42ecbebc730c8c1d3d12f4d18879c589a251
Fix bug 860875: Offer localized build from query param.

Fix bug 860819: Wrap strings for l10n.

https://github.com/mozilla/bedrock/commit/7ae6d1f17e30b68290a256345df42c486a14b40f
Merge pull request #805 from pmclanahan/use-lang-from-stub-installer

Fix bug 860875: Offer localized build from query param.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.