BustByte / coronastatus

Anonymous crowd sourcing of COVID-19 symptoms all over the world (with public data sets)!
MIT License
174 stars 89 forks source link

add functionality for multiple locales #448

Closed fossecode closed 4 years ago

fossecode commented 4 years ago

With multiple locales

image

With only one locale

No flag or anything, like before.

Todo:

amritnagi commented 4 years ago

Awesome work, how can i get it to trigger on my machine? I switched to the branch, but it wasn't showing anything?

amritnagi commented 4 years ago

Just something for discussion.. When i imagined the flags on the design, it was intended to switch between all of the different countries who have a site. What Eirik has done is much better and makes more sense.

So, should we have something which allows people to see all of the countries involved? I know we are intending on having the landing page for that - but if someone starts on a specific country page? Perhaps something in the footer?

fossecode commented 4 years ago

Just something for discussion.. When i imagined the flags on the design, it was intended to switch between all of the different countries who have a site. What Eirik has done is much better and makes more sense.

So, should we have something which allows people to see all of the countries involved? I know we are intending on having the landing page for that - but if someone starts on a specific country page? Perhaps something in the footer?

Maybe we could add a similar page as this where we link to all the pages, and a link to that page in the footer?

fossecode commented 4 years ago

Awesome work, how can i get it to trigger on my machine? I switched to the branch, but it wasn't showing anything?

You have to update your config.json, you should have these three fields:

  "LOCALE": "nl",
  "COUNTRY_CODE": "nl",
  "SUPPORTED_LOCALES": ["nl", "en-US"],

You will get more flags by adding supported locales to the SUPPORTED_LOCALES

michaelmcmillan commented 4 years ago

This is sick! Well done :)

Two questions, because I'm curious:

  1. Could we have used flag emojis instead of the svgs, or are they not supported in all operating systems?
  2. Now we're basically mapping locale to a flag, and a flag represents a country. So transitively speaking I guess we're mapping a locale to a country, which has been the source of headaches previously in this project – is that a problem here?
fossecode commented 4 years ago

This is sick! Well done :)

Two questions, because I'm curious:

  1. Could we have used flag emojis instead of the svgs, or are they not supported in all operating systems?
  2. Now we're basically mapping locale to a flag, and a flag represents a country. So transitively speaking I guess we're mapping a locale to a country, which has been the source of headaches previously in this project – is that a problem here?
  1. On my RHEL 7 many emojis don't work, so I think we should use SVG to be sure.

  2. Thought about this myself and also had a look around, and it seems that is pretty common to represent languages with flags. But as Luke pointed out, it might be weird in Switzerland where you have like 4 different countries (and no Swiss flag). Before the locale/language problems caused issues throughout our whole codebase. The good thing now is that it is just a mapping in the view-layer, so is pretty much isolated from everything else. I suggest that we try it out, and if it is confusing for user we change it :)