Only cache the languages which are in use (see #6013)