Yesterday I once again got stuck with a seemingly simple task that quickly turned out to be a veritable rabbit hole:

In a client website the header images are managed using the 'resources' tab of a page. File references are stored in the 'media' column of the pages table in the database.

The site is set up for multi language, has language fallbacks set and for page contents everything works as expected. But when a translation of a page is created, those file references are gone for the translation, resulting in this case in having no header images on the translated pages.
As an extra, those header images are fetched with TypoScript using a 'slide' up the page tree, so that a page's children will show the parent's header image if no image is set directly on that page.

So my first stop was to check with the TypoScript to see if I had missed specifying the sys_language_uid for the media records, or to hard wire it to sys_language_uid=0 aka the default language. But since everything regarding images and files is now handled with the FAL, I FALfailed to find the right approach where to check for the language.

lib.herofile.file {
    import.dataWrap = {file:current:storage}:{file:current:identifier}
    width = 1440
    height = 640c
lib.heroimage = COA
lib.heroimage {
    # get image from current page, resources/media field
    10 = FILES
    10 {
        references {
          data = levelmedia:-1, slide
          sys_language_uid = 0 # < -- does not work
        renderObj = COA
        renderObj {
            10 = IMAGE
            10 {
                file < lib.herofile.file
                file {
                    height = 400c
           = file:current:crop
       = file:current:alternative
                emptyTitleHandling = keepEmpty
                params = class="hero-image"

I visited the TYPO3 slack channel and had a chat with Benjamin Kott (the guy behind the TYPO3 bootstrap package and other goodies), and to my surprise this wasn't just a case of me missing a TypoScript spell, but a rather complex problem, that has been solved for the new TYPO3 9 version, but needs some TCA override voodoo for the 8.7 version. Benny was so kind to check and research, having a hunch of where to look, and after a short while he came back with the solution to my problem:

$GLOBALS['TCA']['pages']['columns']['media']['config']['behaviour']['allowLanguageSynchronization'] = 1;

This line needs to be set in an extension (in `Configuration/TCA/Overrides/page_overlay.php`), only then a checkbox to use the default language page's media will be shown in the backend on the translated page's 'resources' tab. The checkbox is set by default. After that override is in place, every default language page needs to be saved once -- only then the image-references will be syncronized to the translations.

As ususal with my TYPO3 problems, there always is a solution, but it is _so_ hard to find (for me). Without the help of Benny, I would have ended up re-setting the header images for the translated pages manually, or by setting them directly in mysql with all risks included.

So again, thank you Benjamin for being so kind to put in your own precious time to find this!