Skip to content

Commit

Permalink
imp - Current user language should be conditionally set
Browse files Browse the repository at this point in the history
---

When using UserLang to change the language for other users, we need to set the current language only if we're doing it on ourselves.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Mar 9, 2024
1 parent 7bdc0e3 commit b8d7205
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/Nitrocid/Shell/Shells/Admin/Commands/UserLang.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public override int Execute(CommandParameters parameters, ref string variableVal
else if (LanguageManager.Languages.TryGetValue(lang, out LanguageInfo langInfo))
{
// Do it locally
LanguageManager.currentUserLanguage = langInfo;
if (UserManagement.CurrentUser.Username == userName)
{
LanguageManager.currentUserLanguage = langInfo;
UserManagement.CurrentUser.PreferredLanguage = lang;
}

// Now, change the language in the user config
UserManagement.Users[userIndex].PreferredLanguage = lang;
Expand Down

0 comments on commit b8d7205

Please sign in to comment.