Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save user country country #887

Closed
alexfauquette opened this issue Feb 17, 2024 · 7 comments · Fixed by #892
Closed

Save user country country #887

alexfauquette opened this issue Feb 17, 2024 · 7 comments · Fixed by #892

Comments

@alexfauquette
Copy link
Member

alexfauquette commented Feb 17, 2024

Followup of #879 (@teolemon, @benbenben2 if you have an opinion on the behavior)

In /settings we allow to set the language but not the country.

image

The idea would be to to save in the localeStorage the user country.

By default country should not be defined (equivalent of being set to world)

If a default country is set, it should be used in most games. Especially in the eco-score dashboard

@Gaurav-Verma07 you might be interested by this follow up

@teolemon
Copy link
Member

A drop-down with world and all countries could be interesting,

If we're looking for more sophistication, a multi select, or even groupings of Spanish/French/English speaking countries could be interesting as well.

@Gaurav-Verma07
Copy link
Contributor

@alexfauquette
So, we've to add a coutry drop-down in settings page and save that country in the localStorage.
Additionally, we use this country as default in eco-score page .

@Gaurav-Verma07
Copy link
Contributor

@alexfauquette
should I use /assets/countries.json or /pages/sco-score/index/countryNames to populate countries dropdown in settings.
Since if I use countries.json then some coutries like kenya, india, etc doesn't relate with eco-score/countryNames and cause unwanted bugs.
However, /pages/sco-score/index/countryNames works just fine but then user from some country can't find their country name in the dropdown.
For now, I've used /pages/sco-score/index/countryNames.
Need you views on this.

@Gaurav-Verma07
Copy link
Contributor

Hey @alexfauquette any updates on this feature.
I see my PR closed.

@alexfauquette
Copy link
Member Author

Seems you closed it 🤔

image

should I use /assets/countries.json or /pages/sco-score/index/countryNames to populate countries dropdown in settings.

Nice observation. Might be better to use /assets/countries.json Otherwise you might get people from other countries asking to add their one.

The eco-score is a bit special. It's a project we launched mostly for france and neighbors county so we used a restricted list of country.

I see two solution to avoid the bug. Modify the country selector in eco-score page to support all countries, or do a hack to add the URL country in the list of options

@Gaurav-Verma07
Copy link
Contributor

I suggest to use the /assets/countries.json in eco-score page too then we can remove countryNames from eco-score.
I checked manually the eco-score page api did support for other coutries like india, afghanistan, etc

@Gaurav-Verma07
Copy link
Contributor

Updated the PR.
please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants