lovelace-website icon indicating copy to clipboard operation
lovelace-website copied to clipboard

My preferred language is not remembered

Open tiitlan opened this issue 4 years ago • 3 comments

Each time I start a new problem, Python is selected instead.

tiitlan avatar Apr 17 '21 15:04 tiitlan

Yes indeed this would be nice. Right now it's a static dropdown box so it doesn't remember what language was previously picked.

I'm not sure how to add support for it right now but we should look into it since it would also help with #132.

If you or anyone else knows how to remember things like this between page visits please do share! I'm assuming it requires something like cookies?

ali-ramadhan avatar Apr 18 '21 21:04 ali-ramadhan

I think this is a good use-case for local storage. Using cookies could also work too, but local storage has the easier api, and keeps data "local", unlike cookies which will send the cookie to the server on each request (which isn't really a big concern for this data, but why send more data than you need to?).

BinaryFissionGames avatar Apr 19 '21 02:04 BinaryFissionGames

Oh cool I didn't know about local storage.

I guess we can use it to save someone's preferred language, the order of the problems table, code editor settings (if we have them in the future), etc.

ali-ramadhan avatar Apr 21 '21 22:04 ali-ramadhan