Fix EZP-23532: Languages lost from content when using packages

Applied Gaetano's old fix from EZP-16847 after verifying that it still works.

https://jira.ez.no/browse/EZP-23532
https://jira.ez.no/browse/EZP-16847