bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Add the translation bar back to the site

Open pmac opened this issue 6 years ago • 8 comments

Bedrock used to have a translation bar (part of an info bar) that would pop up if we detected that the user viewing a page preferred a language in which the page was available, but which wasn't the current translation being viewed. The code still exists in the info-bar repo.

This will be a much better UX than either continuing to use the current translation or finding the language switcher in the footer. It is also a step on the way to removing l10n redirects from the site.

pmac avatar Feb 26 '19 19:02 pmac

If we're gonna do this can I suggest removing the jQuery dependency from that repo? We're actively trying to remove jQuery code from bedrock now that we're transitioning the site to Protocol.

alexgibson avatar Feb 28 '19 11:02 alexgibson

The tabzilla.lang files will need to be restored when we do this. They were removed in:

https://github.com/mozilla-l10n/bedrock-l10n/commit/5a03cc088ec83f328e5c36bab5d63896821357ab

Or the translations will need to be migrated to Fluent.

pmac avatar Apr 30 '20 22:04 pmac

Some time has passed since we had this feature, and it's something I agree would be nice to add back. Going to add this to the technical roadmap as a thing to migrate to modern code / standards.

alexgibson avatar May 17 '22 15:05 alexgibson

Agreed. This would be a UX win.

pmac avatar May 17 '22 15:05 pmac

I'm going to work on this. It would be helpful to get a visual of what this used to look like if there is one. @alexgibson Do you have an old screenshot? Or recommendations on what this should look like if not?

I experimented with code on Friday and have the basics of the best available language based on the intersection of the in-page link[hreflang]s and the navigator.languages.

robhudson avatar Jun 24 '22 23:06 robhudson

Do you have an old screenshot? Or recommendations on what this should look like if not?

I can't seem to find any old screenshots, but I remember the UI being pretty simple. It was a short horizontal bar that appeared right at the top of the page, above the navigation, spanning the full width of the viewport.

I did manage to find the original strings in git history:

  • Would you like to see this page in your language?
  • Yes, please!
  • No, thanks.

Clicking yes would redirect, and clicking no would set a cookie to prevent the bar showing again.

Poking around in the original code, it looks like we also did a few other clever things, like disabling Chrome's translation bar when our own bar was shown: https://github.com/mozilla/mozilla-infobar/blob/master/js/infobar.js#L446-L447

alexgibson avatar Jun 27 '22 09:06 alexgibson

@robhudson also, happy to help with any front-end bits if you need a hand here. Just let me know

alexgibson avatar Jun 27 '22 09:06 alexgibson

This one needs info from Elise, who is working on some related UX work

alexgibson avatar May 09 '23 16:05 alexgibson