D8 backports from Hellomrcat d8 langcode

Replacement PR for https://github.com/backdrop/backdrop/pull/451.

Fixes 3 backports from https://github.com/backdrop/backdrop-issues/issues/106.