mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-07 21:30:36 -05:00
[GH-ISSUE #1547] Bug: Web Dashboard forgets language settings after a day #1952
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FabianBartl on GitHub (Sep 26, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1547
When I change the language setting in the web dashboard and reload the page it remembers it. But after a day or so, the dashboard unfortunately forgets it.
It would be nice, if the set language is stored per user on the server; so if a user logs in, the last set language is automatically selected indepent of the device.
Edit: I use the latest pangolin version v1.10.3
@hhftechnology commented on GitHub (Sep 28, 2025):
i think bug occurs because the language setting is likely stored in a cookie that expires after a day. to fix this, i think we need to store the selected language on the server and retrieve it when the user logs in. i don't know how much work this will cause and what impact will it be on migrations, but this is the only stable method i can see.
1. update the user schema
first, add a
localefield to your user schema inserver/db/pg/schema.tsorserver/db/sqlite/schema.ts2. create an API Endpoint to update the Language
create a new API endpoint to update the users language preference in the db.
a new file
server/routers/user/updateUserLocale.ts:add a new route to your user router in
server/routers/user/index.ts:3. update the
LocaleSwitchercomponentmodify the
LocaleSwitcherSelectcomponent to call the new API endpoint whenever the user selects a new language. we usetrpcto make the API call.in
src/components/LocaleSwitcherSelect.tsx:4. load the Users locale on login
to load the users preferred language from the db when they log in and set it as the current locale.
we need to modify the
i18n/request.tsto get the locale from the users session.i think these changes will make sure that the users language preference is saved to their profile and automatically applied when they log in, regardless of the device they are using.
@hhftechnology commented on GitHub (Sep 28, 2025):
@Pallavikumarimdb can you look into this if this makes sense?
@Pallavikumarimdb commented on GitHub (Sep 29, 2025):
Hey @hhftechnology , Thanks for the suggestion! You’re right - saving the locale per user on the server would make it persistent across devices, unlike the current cookie/browser-heade approach. The tRPC-style query/mutation example you shared doesn’t quite fit Pengolin though, since we don’t use that pattern here.
@hhftechnology commented on GitHub (Sep 29, 2025):
Not an expert so I tagged an expert @Pallavikumarimdb . Hehehehehe you can take it from here
@17AnuragMishra commented on GitHub (Oct 5, 2025):
So, is anyone working on this? Or can I contribute!
@oschwartz10612 commented on GitHub (Oct 5, 2025):
@17AnuragMishra feel free to give it a shot!
@17AnuragMishra commented on GitHub (Oct 5, 2025):
Thank you, I'll do my part!
@tim-van-dijkhuizen commented on GitHub (Oct 11, 2025):
+1 would be great of language selection was stored in a user's profile
@rdev99 commented on GitHub (Oct 29, 2025):
@17AnuragMishra are you working on it, if not can I try ?
@17AnuragMishra commented on GitHub (Oct 29, 2025):
Yeah working on it, will raise a pr on this upcoming weekend. > @17AnuragMishra are you working on it, if not can I try ?
@Fizza-Mukhtar commented on GitHub (Mar 2, 2026):
Hey! @oschwartz10612 I noticed this issue has been open for a while with no PR, so I went ahead and submitted one.
The fix extends the cookie lifetime to 1 year and also persists the locale to the database via a new endpoint. Happy to make any changes if needed!