Skip to content

fix(admin): top bar language and Admin Panel Language stay in sync - #106

Open
Hiddify-Official wants to merge 1 commit into
hiddify:devfrom
Hiddify-Official:fix/admin-lang-sync
Open

Hiddify-Official wants to merge 1 commit into
hiddify:devfrom
Hiddify-Official:fix/admin-lang-sync

Conversation

@Hiddify-Official

Copy link
Copy Markdown
Contributor

Problem

A super admin changes the language from the top bar (e.g. to Persian) and the panel switches, but Settings → Admin Settings → "Admin Panel Language" still shows English.
Root cause: the top bar saves only the admin's own language (admins/me/language/), while the Settings field is the panel default admin_lang. The admin's own language wins over the default, so the two drift apart.

Change

  • restapi/v2/admin/admins_api.py (MyAdminLanguageApi): a super admin's choice also sets admin_lang. Other admins (no Settings page) still change only their own language. Choosing "panel default" (empty) does not touch admin_lang.
  • restapi/v2/admin/settings_api.py (SettingsApi.put): when a save changes admin_lang, the signed-in admin's own language follows it. Otherwise their earlier top-bar choice would keep the UI in the old language.

Screenshots

Persian UI (language set from the top bar), Settings → Admin Panel Language:

Before After
before after

Tested

  • Deployed to main, node1 and node2 (panel restart). On main, as the super admin:
    • top bar → fa: own fa, admin_lang fa
    • Settings → ru: own ru, admin_lang ru, and the response asks for a reload
    • top bar → en: both en
  • No errors in the panel log.
  • Not tested with a non-super admin (no such account on the test servers); that path is unchanged apart from the _is_super check.

Review

  • Confidence: High (>90%): two small server-side changes, verified end to end through the API and the UI.
  • Complexity: Simple: two endpoints, no migration or API shape change. Behaviour note: a super admin's top-bar choice now also changes the default language for admins who have not picked their own.

🤖 Generated with Claude Code

…stay in sync

A super admin's language from the top bar was saved only on their account,
so Settings kept showing the old panel default. Now that choice also sets
admin_lang, and saving admin_lang in Settings sets the admin's own language.
Other admins (no Settings page) only change their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hiddify-com

Copy link
Copy Markdown
Contributor

نه دوتا حالت داریم

زبان پیشفرض مدیریت که اینجا ست میشه

ولی هر ادمین میتونه برای خودش زبان را تغییر بده در پروفایل خودش

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants