Bug 38370 - UMC: Mixture of german and english under particular circumstances
UMC: Mixture of german and english under particular circumstances
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.2
Assigned To: Florian Best
Alexander Kläser
: interim-1
: 42154 (view as bug list)
Depends on: 39146
Blocks: 40612
  Show dependency treegraph
Reported: 2015-04-27 14:44 CEST by Michael Grandjean
Modified: 2017-04-04 18:28 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): External feedback, Internationalization, Usability
Max CVSS v3 score:

Screenshot with mixed languages (686.52 KB, image/png)
2015-04-27 14:44 CEST, Michael Grandjean
patch for problem 2 (860 bytes, patch)
2015-11-10 17:48 CET, Florian Best
Details | Diff
patch (2.41 KB, patch)
2016-04-26 13:11 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2015-04-27 14:44:32 CEST
Created attachment 6857 [details]
Screenshot with mixed languages

It is possible to receive parts of the UMC with english text and at the same time other parts with german text.

I've seen this twice during workshops, but unfortunately wasn't able to track it down, yet. I guess this is the result of some combination of language settings on the client OS, client Browser, in the UMC, user agent ...
Reload with CTRL + SHIFT + R (overriding browser cache) did not help.

Screenshot attached, where ...
- Windows is german
- Firefox is german
- UMC language selection is german
- text is partly german and partly english
Comment 1 Florian Best univentionstaff 2015-04-27 14:55:23 CEST
The reason is that there still exists a english running module process. Pressing F5 will not create a new session. Workaround is doing a real logout.

I don't know if we should fix anything here.
Comment 2 Alexander Kläser univentionstaff 2015-04-27 15:10:02 CEST
I see two possible explanations for this behaviour:

(a) By opening a second tab, the locale which is used for the current user session in the backend is changed. Consecutive requests from a previous tab (in the "old" locale) will then respond in the new locale.

(b) If locale (and locale/default) are set to EN_US.UTF-8 and the default browser locale is detected as German, it might be that DE_DE is set as locale, although the backend only supports EN_US. As the German translations files for the frontend are there, these will be used by JavaScript nevertheless.
Comment 3 Alexander Kläser univentionstaff 2015-05-27 13:33:46 CEST
See Bug 38129, comment 5:
> Hm... not really. I still experience this problem (on 2 different VMs). We
> observed that we have different locales on our VMs, Florian (as you did not
> observe this problem):
> locale/default: de_DE.UTF-8:UTF-8
> locale: de_DE.UTF-8:UTF-8 en_US.UTF-8:UTF-8
> Curiously, the /proc/XYZ/environ file contains: LANG=de_DE.UTF-8
Comment 4 Alexander Kläser univentionstaff 2015-05-28 10:15:48 CEST
(In reply to Alexander Kläser from comment #3)
> [...]
> > Curiously, the /proc/XYZ/environ file contains: LANG=de_DE.UTF-8

I.e., XYZ is the PID of the appcenter UMC module process.
Comment 5 Alexander Kläser univentionstaff 2015-06-01 11:12:04 CEST
+1 ... this problem has also been seen during a technical training.
Comment 6 Alexander Kläser univentionstaff 2015-06-01 11:22:27 CEST
(In reply to Alexander Kläser from comment #5)
> +1 ... this problem has also been seen during a technical training.

Happened after a fresh installation of UCS.
Comment 7 Michael Grandjean univentionstaff 2015-06-01 19:06:48 CEST
(In reply to Alexander Kläser from comment #6)
> Happened after a fresh installation of UCS.

+ 1 today in another technical training.
Comment 8 Florian Best univentionstaff 2015-11-09 15:03:43 CET
In UCS 4.1 a explicit "set locale" is done on each authentication or session-login. On UCS 4.0-3 this can be reproduced by opening the udm users/user "Add" wizard and replace the query string parameter ?lang=de-DE to ?lang=en-US.
The "set locale" call is not reached down through the running UMC module processes. We could do this as well (REOPEN the bug then).
Comment 9 Florian Best univentionstaff 2015-11-10 17:37:00 CET
Hm, it just occurred during product tests: I installed a app and ignored the "reload page" instruction. After this I had mixed translations. A page reload didn't help.

App descriptions on the overview are german. All others are translated correctly.
The UDM javascript translations are fine but the backend translations are all german.
Comment 10 Florian Best univentionstaff 2015-11-10 17:48:01 CET
Created attachment 7278 [details]
patch for problem 2

1. univention.lib.i18n.Translation is something like a singleton which uses the same locale for every instance. A process (like UMC) which uses multiple instances of it with different languages can't use it then.

2. The language of the running module processes is not changed when the language gets changed (e.g. by page reload).

3. The locale is reset when importing/reloading syntax.py (due to Bug #39146).
Comment 11 Florian Best univentionstaff 2016-04-26 13:11:55 CEST
Created attachment 7621 [details]

Got a reproducible way:
# ucr dump | grep locale
locale/default: de_DE.UTF-8:UTF-8
locale: de_DE.UTF-8:UTF-8 en_US.UTF-8:UTF-8

On a german system in an english session ?lang=en-US the following JS code will cause that the session will be reset to german.
umc.tools.renewSession().then(function() {

Attached is a patch.
Comment 12 Florian Best univentionstaff 2016-09-19 18:02:01 CEST
*** Bug 42154 has been marked as a duplicate of this bug. ***
Comment 13 Florian Best univentionstaff 2017-02-02 18:13:58 CET
Done in combination with Bug #38370.

The "Accept-Language" header is passed along with each request to the server and module proccesses. The session will use the new language if it changed. HTTP requests which don't come from our Javascript framework don't cause an language update e.g. so that the language is not updated by the browser wide setting when receiving a computerroom/screenshot.

univention-web (1.0.8-6):
r76194 | Bug #40612: jshint coding style
r76161 | Bug #40612: Add language switch to the menu bar
r76132 | Bug #40612: set authentication via HTTP header during login

univention-management-console (9.0.21-2):
r76335 | Bug #40612: Bug #38370: fix updating of language
r76160 | Bug #40612: Add language switch to the menu bar
r76134 | Bug #40612: Bug #38370: fix language mix after e.g. installing a app
r76133 | Bug #40612: set authentication via HTTP header during login

univention-lib (6.0.6-7):
r76335 | Bug #40612: Bug #38370: fix updating of language
Comment 14 Alexander Kläser univentionstaff 2017-02-15 14:18:18 CET
As discussed, there is still some mixture between languages when choosing in the menu "Change language". We will need to stop the session module processes in order to be able to restart the module processes with the new language. However, this should only be done if the change language request is triggered from within UMC ... just to avoid side effects with running module processes when changing the language, e.g., from within the portal.
Comment 15 Florian Best univentionstaff 2017-02-15 14:19:28 CET
univention-web (1.0.22-1):
r76688 | Bug #38370: renew session before switching language in UMC
Comment 16 Alexander Kläser univentionstaff 2017-02-16 15:18:03 CET
Changes: OK, works as discussed
Changelog: OK

Comment 17 Stefan Gohmann univentionstaff 2017-04-04 18:28:44 CEST
UCS 4.2 has been released:

If this error occurs again, please use "Clone This Bug".