User interface for language selection


@byeskille mentionned the possibility of adding a language selection to the journalist / source interface. The simplest way to do it is with a drop down menu, in the same way most web site are expected to.

In fact @heartsucker already implemented that a few months ago and we could just make a pull request out of this.

If three people vote in favor I’ll work on that :wink: It does not mean it will be merged, but it’s worth a shot.

  • Add a user interface to choose the source / journalist language
  • Do not allow the user to select the language other than with the Accept-Language header

0 voters

Echoing what I said in another thread: forcing a user to use the language set in the headers and not allowing an override is just all sorts of UX gore. The user could be using a public computer (library) or the translation might be bunk, and they want to switch languages to remove some of the ambiguity. Etc.

Ok then, I’ll work on that right away :wink:

I moved the list of available languages under the SecureDrop logo:

It could be prettier but I suck at web design. If someone provides me with an image that looks better I’ll dot he CSS/HTML integration :wink:

The name of the languages are from the iso-639 python module. This may not be the best way and I’m open to suggestions. It feels good that the language names come from an externally maintained list though.

Now to writing tests and make a proper commit out of this.

Here is how the three different pages look. Journalist interface (all pages the same), Source index and all other Source pages.

The corresponding commits are locale selection with the l argument and language selection on the page

Some things need work:

  • it looks kind of crappy
  • iso-639 is probably not the right module to use
  • locale.html is duplicated and are exactly the same for both journalist and source

Indeed, it’s entirely unecessary. Instead the following provides a good enough localized language name suitable for a menu:

from babel import core
locale = core.Locale.parse('fr_FR')

it’s not entirely intuitive nor documented but reading babel module code helps.

Not sure what module to use, but definitely it should display the languages

  • in their native language (e.g., “Deutsch” and not “German”)
  • alphbetically by their display language (e.g., “italiano” after “espnanol” and not before because in English it’s Spanish)

This is how it’s done on most websites and what will be easiest to use. And it seems like that’s what you’re doing, so well done. :slight_smile:

Also, it would be good to display the dialect because this could help a reader understand semantic differences between words that are shared between dialects (e.g., “Deutsch (Deutschland)” ), and we as non-natives in these other languages shouldn’t make any assumptions. Though this last point might be debatable.

1 Like

that’s what I tried first but it does not fit and that looks really ugly. Instead of trying something creative by myself I thought best to wait until someone with some level of web design skill has an idea :wink: Do you know someone by any chance ?

There once was a Ms. Nina who was contributing some pretty nifty designs. I think she was roped in by the FPF kids, so maybe you could ask them about reaching out to her again or finding someone else.

1 Like

Alain-Olivier strongly recommends that languages in the menu start with an upper case, always.