leanprover-community / lean4game

Server to host lean games.
https://adam.math.hhu.de
GNU General Public License v3.0
137 stars 25 forks source link

Add a search parameter that makes it easier for people to share links in their preferred language. #220

Closed JiechengZhao closed 1 month ago

JiechengZhao commented 2 months ago

if people add ?lang=zh in the url, they will get the Chinese version of the game.

joneugster commented 2 months ago

I agree that having the language in the URL is a good idea, but I think it should be better integrated with the preferences.

If I understand this suggestion correctly, then a tag in the URL will overwrite the preferences and changing them will not do anything. Better if the tag changes according to the preferences set.

JiechengZhao commented 2 months ago

I agree that having the language in the URL is a good idea, but I think it should be better integrated with the preferences.

If I understand this suggestion correctly, then a tag in the URL will overwrite the preferences and changing them will not do anything. Better if the tag changes according to the preferences set.

My experiment in the local environment shows that clicking ☰ will remove the search parameter in the URL. Therefore, changing the preference will change the language.

Another related issue might be that the language option is too deeply embedded in the UI, making it difficult for people to change it. I feel add a search parameter is a quick fix that meet my needs to share the game. We can make a complete better design later.

joneugster commented 1 month ago

https://adam-dev.math.hhu.de/#/g/leanprover-community/nng4

I added the language button to the top navigation on all pages. This should already make it much easier to switch languages.

joneugster commented 1 month ago

I implemented the feature, and it can be tested at the dev-server above :) Thanks for the suggestion and template!