fix: persist user locale preference in database across sessions #165

Closed
opened 2026-04-05 17:01:48 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Fizza-Mukhtar on 3/2/2026

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Fixes #1547

Problem

Language preference was stored in a cookie which expires after ~1 day, causing the dashboard to forget the selected language.

Fix

  • Added locale field to user schema (SQLite + PostgreSQL)
  • Added DB migration 1.16.1 for both databases
  • Added POST /user/locale endpoint to save locale to DB
  • getUser endpoint now returns user's saved locale
  • Cookie expiry extended to 1 year as fallback
  • When user changes language, preference is saved to DB silently
*Originally created by @Fizza-Mukhtar on 3/2/2026* ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. Fixes #1547 ## Problem Language preference was stored in a cookie which expires after ~1 day, causing the dashboard to forget the selected language. ## Fix - Added `locale` field to user schema (SQLite + PostgreSQL) - Added DB migration `1.16.1` for both databases - Added `POST /user/locale` endpoint to save locale to DB - `getUser` endpoint now returns user's saved locale - Cookie expiry extended to 1 year as fallback - When user changes language, preference is saved to DB silently
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#165