gettext.c: move get_preferred_languages() from http.c