Closed Bug 773371 Opened 8 years ago Closed 7 years ago

[bedrock] Integrate Language Selector for M.o

Categories

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

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: arky, Assigned: kohei)

References

(Blocks 1 open bug)

Details

(Whiteboard: [kb=1082569] [u=user c=bedrock p=])

Attachments

(1 file)

Universal Language Selector tool that will allow users to select a language and configure its support in an easy way. 

Please allow users to switch the language of m.o website. 


Technical specification:
http://www.mediawiki.org/wiki/Universal_Language_Selector

Source code:
https://gerrit.wikimedia.org/r/#/q/project:
mediawiki/extensions/UniversalLanguageSelector,n,z
Ricaud, Can you please add this to bedrock project.
Summary: Integrate Language Selector for M.o → [bedrock] Integrate Language Selector for M.o
That seems like a good idea. That said, I don't have time to work on this.

I can surely mentor anyone who wants to work on this.
Component: Webdev → www.mozilla.org
Product: mozilla.org → Websites
Whiteboard: [mentor=anthony@ricaud.me]
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
hello Anthony,

I am a newbie --I want to work over this bug..
Kindly help me with mentor

Thanks in Advance

Meghashyam
Meghashyam, that is great. Check out the bedrock code and submit your patch. https://github.com/mozilla/bedrock
Meghashyam, Did you get a chance to look at the code?
Arky pointed me to this bug in #languagesummitpune today. I am already having working code, will submit a patch in few hours.
Kushal: Great. I think I put this bug in a mentored list a bit early as we haven't really decided how to integrate it and if it makes sense.

Holly: I guess we'll need some input on this to know how to integrate this language selector. Header? Footer? Pascal can give us input here.
Screen shot of the translated ui of the ULS 

http://kushal.fedorapeople.org/screen3.png
Blocks: 756032
Thank you for your work Kushal. This feature would really help us deliver localized versions of our products more efficiently by allowing user selection via ULS.
No longer blocks: 756032
Blocks: 756032
Jennifer, Can you please share your thoughts on adding language selector on m.o
Hi Arky-

Before we consider the language selector, we need to finish bringing all the content from PHP to Bedrock and finish localizing the full site.  Then we can look at how to integrate this into the site.

Holly and Pascal - thoughts? 

Kushal - thanks for all your work on this!

-Jen
Jen, Thank you for the response. Do you have timeline when you'll finish porting all legacy code to bedrock. 

That will give me an idea when to follow-up with this bug and few others for improving the discoverability of our localized products.
(In reply to jbertsch from comment #13)
> Hi Arky-
> 
> Before we consider the language selector, we need to finish bringing all the
> content from PHP to Bedrock and finish localizing the full site.  Then we
> can look at how to integrate this into the site.
> 
> Holly and Pascal - thoughts? 

Jen, why would we block on a full localization of the site, all being on bedrock?

Other questions:

* Kushal, how does that selector deal with pages being available only in a few languages? Also, I'm pretty sure that overwriting the protocol with 'http' isn't what we should do.

* anybody, do we have best-practices in bedrock on how to include code that's not under MPL2?
Removing myself as I'm not able to mentor this anymore.
Whiteboard: [mentor=anthony@ricaud.me]
Jen, Kaushal

Do you have any responses to Axel's question in comment #15 ?
Hi guys,

Since Rik is no longer on mozilla.org, mkelly, pmac, and I are the bedrock devs, though I'm a tertiary dev at best in terms of time.

(In reply to Axel Hecht [:Pike] from comment #15)
> Jen, why would we block on a full localization of the site, all being on
> bedrock?

I think jen's point is that we don't want to expend primary dev time on this until we've finished porting. I think that makes sense, this doesn't seem like an extremely high priority to me unless someone has a reason that it should be.

I don't see any reason we can't continue to mentor this bug and if you guys come up with a working solution earlier than that, all the better in my mind.
Priority: -- → P4
Whiteboard: [u=user c=email p=]
Whiteboard: [u=user c=email p=] → [u=user c=bedrock p=]
Bumping this bug for further discussion in bedrock meeting
adding a comment to a bug does not 'bump' it in any meaningful way :P
Component: General → Bedrock
Blocks: 875293
Hi, I have implemented a simple language switcher with a list of all available translations of the current page. Kushal's work looks great but it may take more time to refine the design, so I'd like to see a simple switcher tentatively like one on the legacy PHP side.

My pull request is here: https://github.com/mozilla/bedrock/pull/989

Please take a look.
OS: Linux → All
Hardware: x86 → All
This simple switcher would be needed anyway for noscript environments. The implementation exposes the available translations of the current page, so it may be helpful for the development of the richer Universal Language Selector as well as the alternate URLs (Bug 875293). Arky, thoughts?
Flags: needinfo?(hitmanarky)
Does anyone have any feedback on that simple locale switcher?
Flags: needinfo?(pascalc)
No longer blocks: 875293
(In reply to Kohei Yoshino [:kohei] from comment #23)
> This simple switcher would be needed anyway for noscript environments. The
> implementation exposes the available translations of the current page, so it
> may be helpful for the development of the richer Universal Language Selector
> as well as the alternate URLs (Bug 875293).

Moved the backend code to Bug 481550, so my simple lang switcher implementation won't block Bug 481550 as well as Bug 834422.
Depends on: 481550
arky, pascalc: Any feedback?
a simple lang switcher is probably more what we need, +1 for me.
Flags: needinfo?(pascalc)
This simple language switcher is important for us to expose our localize builds.  +1 

Is it possible to have a search box at the top of language option list?
Flags: needinfo?(hitmanarky)
(In reply to arky [:arky] from comment #28)
> Is it possible to have a search box at the top of language option list?

I think we can have a search box once a richer language switcher, which Kushal Das was working on, is implemented on mozilla.org. This simple switcher, exposing an available translation list, can be a first step to do so.

Thanks for your feedback! Now we can proceed to a code review.
No longer depends on: 481550
Depends on: 903886
Whiteboard: [u=user c=bedrock p=] → [kb=1082569] [u=user c=bedrock p=]
Kohei: Just to confirm, it will only show the languages available for a given page. So, if a page is en-US, it will only show en-US in the drop down window.

Also, I would like to get Google Analytics events hooked up to the selector so that we can determine how many people are using it and on what page. We can make the onSubmit of the form, send the event to GA with the language, pause for few hundred milliseconds, and redirect to the new locale.

Gareth: Can you provide Kohei the GA event that should get set when someone chooses a different language on a page? I am pretty sure that the event itself already grabs the current URL so we just need the event to know the action was taken to switch languages and the rest of the page metrics should come along naturally.
(In reply to Chris More [:cmore] from comment #30)
> Kohei: Just to confirm, it will only show the languages available for a
> given page. So, if a page is en-US, it will only show en-US in the drop down
> window.

If the page is not localized into other languages, the lang switcher won't be shown, as it doesn't make sense.

> Also, I would like to get Google Analytics events hooked up to the selector
> so that we can determine how many people are using it and on what page.

+1
Assignee: nobody → kohei.yoshino.bugs
Status: NEW → ASSIGNED
Blocks: 906943
Blocks: bedrock-l10n
Gareth: Can you check out the code here and see if that is what you wanted for the GA event? https://github.com/kyoshino/bedrock/commit/c6142c10cd064d8518df9eba4174ef496f671a2c#L3R63
Flags: needinfo?(garethcull.bugs)
Chris: What is the final experience going to be like? I also saw this Bug #906943, which is similar but asks the user to confirm a language with a 'YES' / 'NO' based on their browser lang. Or are we allowing our users to select a language from a drop-down? Knowing this informs the value we want to capture within the event action.
Flags: needinfo?(garethcull.bugs)
Gareth: we'll have both - the dropdown menu language selector at the bottom of the page, and the translation bar at the top of the page.

The former GA code may look like:
['_trackEvent', 'Language Switcher', 'change', {LANG}] <- user selects a lang from the menu

And the latter may look like:
['_trackEvent', 'Translation Bar', 'show'] <- the bar appears depending on the user/page locale
['_trackEvent', 'Translation Bar', 'change', {LANG}] <- user clicks Yes
['_trackEvent', 'Translation Bar', 'hide'] <- user clicks No Thanks
Ok. Thanks for the additional info. A couple tweaks to the latter:

Can we please capture the {LANG} that is being shown and the {LANG} the user hides as well. It will just make things a bit easier and consistent when reporting the flow from 'show' to 'change'/'hide' by LANG.

['_trackEvent', 'Translation Bar', 'show', {LANG}] 
['_trackEvent', 'Translation Bar', 'hide', {LANG}]

Other than that, I'm good with this. Thanks Chris!
Gareth: Got it. I'll implement the following GA code for the Translation Bar in Bug 906943.

(In reply to Gareth Cull [:garethc] from comment #35)
> ['_trackEvent', 'Translation Bar', 'show', {LANG}] 
> ['_trackEvent', 'Translation Bar', 'hide', {LANG}]
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/65b303bc9002c0b15ed4f83afd67bd5d8e1b1c7a
Bug 773371 - [bedrock] Integrate Language Selector for M.o

Implemented a simple language switcher UI with a list of all available
translations of the current page.

https://github.com/mozilla/bedrock/commit/7a7d9c19e7fe8d62afc2384a5b63f238f71c37e7
Merge pull request #989 from kyoshino/bug-773371-lang-switcher

Bug 773371 - [bedrock] Integrate Language Selector for M.o
Blocks: 914730
Kohei: Where can we view this working? 

Pmac: I don't want this to go onto production yet. If this is blocking a prod push, we should get it onto another branch or a demo server.
(In reply to Chris More [:cmore] from comment #38)
> Kohei: Where can we view this working? 

It's still on trunk/dev and can be found at translated pages like
https://www-dev.allizom.org/en-US/firefox/os/
https://www-dev.allizom.org/en-US/contribute/
https://www-dev.allizom.org/en-US/about/
The biggest use-case for this lang selector is on this page that is highly translated and often viewed by a locale different than the browser's browser. https://www-dev.allizom.org/en-US/firefox/new/

It is not on that page and we would have to get it added to that base template.
Kohei:(In reply to Chris More [:cmore] from comment #40)
> The biggest use-case for this lang selector is on this page that is highly
> translated and often viewed by a locale different than the browser's
> browser. https://www-dev.allizom.org/en-US/firefox/new/
> 
> It is not on that page and we would have to get it added to that base
> template.

nevermind, I see pmac filed bug 914730. :)
Koehi: What about the idea of showing a header bar that displays only when the lang of the page != the browser's lang? That happens quite often and users may not see the footer selector.
* opps, reversed the letters in your name.
(In reply to Chris More [:cmore] from comment #42)
> Koehi: What about the idea of showing a header bar that displays only when
> the lang of the page != the browser's lang? That happens quite often and
> users may not see the footer selector.

That's what I'd like to see. I'll soon send a PR for Bug 903886.
I'd like to close this bug and file a new bug for a richer language switcher that was proposed first here. I should have filed a separate bug for a simple lang switcher that I have implemented.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Depends on: 919869
Blocks: 919869
No longer depends on: 919869
Here is some fun stats for only September 25th, 2013.

* Language switcher used 46k times across the entire website!
* Most popular page by far used on /en-US/firefox/new/
* Most switched to languages on /en-US/firefox/new/: en-GB, id, ar, de, and es-ES

That's awesome and exactly what I would hope would happen on /firefox/new/ given how popular the en-US version is.
That is great news Cmore!  Thanks for making it happen!  I wonder if we should try to integrate more in the main content area of the page, in a smart way.
I wish the translation bar (Bug 906943) would further improve UX :)
(In reply to Kohei Yoshino [:kohei] from comment #48)
> I wish the translation bar (Bug 906943) would further improve UX :)

I think bug 906943 is the next evolution on the lang selector. Excited!
verified fixed www.mozilla.org/firefox/new/
Status: RESOLVED → VERIFIED
Awesome! Thanks folks. :)
You need to log in before you can comment on or make changes to this bug.