mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #4890] [MERGED] fix(i18n): add 1-year expiration to language cookie #5742
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5742
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4890
Author: @lim-kim930
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @MHSanaei
Base:
main← Head:main📝 Commits (1)
4c6cf9bfix(i18n): add 1-year expiration to language cookie📊 Changes
1 file changed (+4 additions, -4 deletions)
View changed files
📝
frontend/src/utils/index.ts(+4 -4)📄 Description
Summary
Added a 1-year expiration time to the
langcookie in the frontend to make it a persistent cookie instead of a session cookie.Why
Previously, the
langcookie was set without an expiration date, which made it a Session Cookie. This caused users to lose their UI language preference every time they closed and reopened their browser. Additionally, because the backend relies on this cookie to determine the localized language for prompts and errors (web/locale/locale.go), the backend would also fall back to English/browser defaults upon browser restart.Adding a 1-year expiration ensures the user's language setting persists properly and improves the overall user experience.
Type of change
Areas affected
How was this tested?
zh-CN).langcookie now has anExpires/Max-Ageset to 1 year in the future, rather thanSession.Screenshots / recordings
N/A
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.