Repository navigation
fix(admin): top bar language and Admin Panel Language stay in sync - #106
Open
Hiddify-Official wants to merge 1 commit into
Open
Hiddify-Official wants to merge 1 commit into
Hiddify-Official wants to merge 1 commit into
Conversation
…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>
Contributor
|
نه دوتا حالت داریم زبان پیشفرض مدیریت که اینجا ست میشه ولی هر ادمین میتونه برای خودش زبان را تغییر بده در پروفایل خودش |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 defaultadmin_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 setsadmin_lang. Other admins (no Settings page) still change only their own language. Choosing "panel default" (empty) does not touchadmin_lang.restapi/v2/admin/settings_api.py(SettingsApi.put): when a save changesadmin_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:
Tested
fa,admin_langfaru,admin_langru, and the response asks for a reloaden_is_supercheck.Review
🤖 Generated with Claude Code