Redirect admin to default language

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alex
User
Posts: 267

Redirect admin to default language

Post by alex »

Hello! I have set up Default language "ru-RU" and additional language is "en-US". If I login as Admin (id=-1) then I don't redirect to default language nor to additional (considering by uncertain currency symbol - "¤"). How to redirect Admin to default language "ru-RU"?


arbei
User
Posts: 9384

Post by arbei »

  1. Make sure you have specified correct language ID in your language files, see Making Language Files. If the language ID is correct with region (i.e with "-RU" and "-US"), then the currency symbol is known and you will not get "¤".
  2. If you have customized the locale, double check your locale settings.
  3. The super admin is not an user from the users table, the language is not saved.

alex
User
Posts: 267

Post by alex »

  1. The language IDs are correct "ru-RU" and "en-US".
  2. I did. Looks like its ok.
  3. I don't use Super Admin (Hard-coded) option. User "admin" is from "users" table (dynamic user levels) with id = -1 and userLevelId = -1

Redirect after login works fine for all other users also if userLevelId = -1.

Only one user "admin" (id = -1) redirects incorrect (every login) - into "en-US" (not default "ru-RU") with strange currency symbol. For"en-US" locale currency is "$".

Is it possible somehow to force user "admin" (with id = -1) to redirect to "ru-RU" language?


arbei
User
Posts: 9384

Post by arbei »

If the admin is not super admin, you may save the language in Profile field (make sure you have enabled it first). e.g. in User_LoggedIn server event

// Save user language
if ($usr == "admin") Profile()->setUser($usr)->setLanguageId("ru-RU")->saveToStorage(); // Assume the user name is "admin"

alex
User
Posts: 267

Post by alex »

Yes, Profile field is enabled and I found that for user "admin" was "LanguageId":"ru" (not "ru-RU"). I erased all data from Profile field and now redirect works like it should.

Thank you!


Post Reply