Revert "glib: remove legacy gettext workaround"

Turns out this actually still *is* necessary because gettext does not
have a pkgconfig file of its own, and glib-2.0.pc includes references to
gettext.

This reverts commit 57b37ed2d671eb7c40c64df085df3e89759278b4.

Fixes #24952.