tconley / screencovid.com

https://ScreenCovid.com
MIT License
12 stars 10 forks source link

Multi-language support? #21

Open sahuguet opened 4 years ago

sahuguet commented 4 years ago

Is there a plan to provide translations for other languages?

https://github.com/guillaumepotier/gettext.js/ could be an easy way to doing that. I could not find a good jQuery-specific way of achieving this.

Thoughts?

tconley commented 4 years ago

yes, would love if you can help with this, otherwise it's on the list of issues to do :)

sahuguet commented 4 years ago

See https://github.com/tconley/screencovid.com/pull/23 .

I was NOT allowed to create a new branch and a PR. I updated my fork and created a PR from it.

I love the new infographics :-)

tconley commented 4 years ago

@sage-t @sahuguet I think it would be great for usability if on the menu bar there is a flag icon that represents the language, and user can click to change language directly from there. https://dribbble.com/shots/2386084-Language-Selection-Modal ?

Also, we could use the browser preferences to detect the language on initial visit https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language

tconley commented 4 years ago

https://codyhouse.co/ds/components/app/language-picker

sahuguet commented 4 years ago

All are good suggestions.

Keeping the ?lang attribute is important. A very common use-case is to distribute a link, e.g. via a tweet. Based on your audience, the language of the tweet and the link will be different.

tconley commented 4 years ago

agreed the ?lang get url is great

tconley commented 4 years ago

We also need translation for this part

      if (totalscore > 212) {
        $("#results").text("Your score of " + totalscore.toFixed(1) + " indicates that you should consult a doctor immediately");
      } else {
        $("#results").text("Your score of " + totalscore.toFixed(1) + " is below the threshold for COVID-19 pre-screening. However, if you have Difficulty Breathing, Chest Pain, Pressure, or Irregular Heartbeat, Bluish Lips, or Confusion, you should seek medical attention immediately.");
      }
sage-t commented 4 years ago

I'll work on these UI changes and automatic language detection tonight.

sahuguet commented 4 years ago

I sent a PR, pretty straightforward. But there seems to be some conflicts.

tconley commented 4 years ago

image

I still need to work to incorporate @sahuguet latest fix.

tconley commented 4 years ago

I'll work on these UI changes and automatic language detection tonight.

@sage-t - any progress? I've incorporated the other requests at this point. Make sure to grab the latest version as there's been lots of changes.

tconley commented 4 years ago

I've got language auto-detection working, tested by setting my browser to chinese and then it took me 15 minutes to figure out how to get it back to english.

sage-t commented 4 years ago

I created a PR to add the flags, I'm working on highlighting the current language in the UI selectors still but that shouldn't take too long

sage-t commented 4 years ago

Done!

tconley commented 4 years ago

great work @sage-t !