default langue not used

Moderator: crythias

Post Reply
gwarsow
Znuny newbie
Posts: 11
Joined: 09 Aug 2024, 12:17
Znuny Version: 6.5
Real Name: Gregor Warsow

default langue not used

Post by gwarsow »

I set the sysconfig value DefaultLanguage to en. Then, as agent with admin role, I go to Admin->Agent, click on a username, click on the button Edit personal preferences for this agent. In the Preferences, I click on User Profile and find Language to be set to English (United States). This is like I would like this value to be set.

BUT: When I switch to this agent in the Agent Management via Switch to agent (sysconfig value SwitchToUser was set to true), and check the language there, I get Sprache: Deutsch.

I had a look into the user_preferences table, and for the user no UserLanguage value was set - so the default (en) should be applied.

Question: why does this different behavior appear? I would like to set the language for the agents but this does not work via the Edit personal preferences for this agent method, as it seems.

Gregor
bschmalhofer
Znuny newbie
Posts: 16
Joined: 30 Apr 2020, 15:16
Znuny Version: 6.0
Real Name: Bernhard Schmalhofer
Company: Bernhard Schmalhofer
Location: Munich
Contact:

Re: default langue not used

Post by bschmalhofer »

The language is chosen in Kernel::Output::HTML::Layout. See https://github.com/znuny/Znuny/blob/b31 ... ut.pm#L106 . When the user hasn't selected a language then the browser language is used. The setting DefaultLanguage is used only as a fallback.

In my opinion that makes perfect sense. Wenn my browser is in German then I would expect that Znuny is in German per default as well.
gwarsow
Znuny newbie
Posts: 11
Joined: 09 Aug 2024, 12:17
Znuny Version: 6.5
Real Name: Gregor Warsow

Re: default langue not used

Post by gwarsow »

Thanks for the explanation! I agree that it makes sense to infer the language to be used from the browser. Yet, I want to make sure we all use the same wording when we talk about things in znuny.
I am introducing znuny to a group of people and when I am giving a hands-on session, I would prefer that all participants have the same GUI so they can follow along my instructions easily.

Yet, what I do not understand is why the "currently active language" of a certain agent differs depending on whether I access the agent's settings as admin or as the user via the "switch to agent" method: I am using the same browser for both methods but get either "English" (Edit personal preferences for this agent) or "Deutsch" (Switch to agent).
It seems that using the "edit for agent" method uses my (admin's) language settings (I chose Englisch as my UserLanguage) and shows this value, whereas it should have been taken from the agent's settings and not mine.

When searching for an easy way to apply English for all agents (that is, without doing this manually for all >20 agents), I tried to add 'en' as 'UserLanguage' in table 'user_preferences'. But this did not work. I also applied Maint::Cache::Delete on the console as I thought the values might be cached but this did not help as well (still German wording).
What am I doing wrong here (despite not using the intended way -> GUI)?
bschmalhofer
Znuny newbie
Posts: 16
Joined: 30 Apr 2020, 15:16
Znuny Version: 6.0
Real Name: Bernhard Schmalhofer
Company: Bernhard Schmalhofer
Location: Munich
Contact:

Re: default langue not used

Post by bschmalhofer »

I would have guessed that setting the preferences in the database table directly would work. Deleting the cache was a good idea because the prefereces are indeed cached. Did you log off and then log in again? This would force a new session and presumable rereading the preferences.
Post Reply