Review main Merged

68192[FEATURE] Use database field be_users.lang for UI language

Benni Mack CR +2 V +2 Hard +320 −71 updated 03/08/21, 13:14

Commit message

Historically (even before TYPO3 3.3.0), the UI language (the language of
the TYPO3 Backend of a user) is stored in ->uc['lang'], which is only
filled from the database field be_users.lang when a user logs in the
first time.
be_user.lang is/was used for admins when creating users to set a default
language when the user first logs in for the first time, but is never
used afterwards.

However, using "uc[lang]" in various places does not make life easier
because uc always needs to be unpacked (e.g. for sending bulk mails
to users, or changing languages for users as admins, listing
users' preferred languages in list module).

For this reason, be_users.lang now defines the users' UI language,
however uc[lang] is synced on each login of a user now, if the language
has changed.

In addition, the TCA for be_users.lang is now handled via an
itemsProcFunc, making uncached requests a tiny bit faster as Locales are
not populated during TCA creation, and allows for more features such as
dynamically showing available/downloaded languages in a be_users
FormEngine field.

The Setup module now updates be_users.lang instead of uc[lang],
which makes it easier in the future to use native TCA for rendering
the setup module fields.

An upgrade wizard migrates all "uc[lang]" values into "be_users.lang"
and ensures that empty values are never used, instead
"default" (= English) is added to all user records to have an explicit
value (also for new users).

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 21