Media album in second language

Issue #32 resolved
Goarli created an issue

Hello,

I tried - in the "list view" to translate or create a Medi Album for a second language (English). Unfortunately this does not work. Either is displayed in language 1 or language in language 2. It is applied no other record in the "List view" (FE)?!

Thanks

Goarli

Comments (12)

  1. Goarli reporter

    Hi Frans,

    I have expressed myself somewhat complicated.

    My problem is that I try a Media album and its description to translate in a second language.

    There is the language option but has no effect. I do something wrong?

    I want the same pictures / Gallery, only the description should be to create in the alternative language.

    thank you

    Goarli

  2. Goarli reporter

    Hello Frans,

    Yes, the Storage Folder which holds the album records also applied in the second language. Everything else also - the plugin itself that individual albums etc.!

  3. Goarli reporter

    In the default language the corresponding album will be displayed. On the side with the alternative language, the albums of all languages are displayed ?!

  4. Frans Saris repo owner

    Hi Goarli,

    Pushed a TCA changed to get it working for the nested album view. Could you test if this also fixes it for you?

    I think you need to check all existing translated albums (set parent album + album date when needed)

    groet Frans

  5. Goarli reporter

    Test of your last master version:

    In the file list, I have created 2 folders (with images).

    After that I created from the two folders each a Media album (in the file list view).

    • For the 1st Media Album, the language setting is set to standard and a date set.

    • For the 2nd Media Album, the language setting is set to the alternative language and a date set.

    On the (FE) pages of standard and alternative language I respectively inserted the plugin.

    When I set the "nested album view" in BE and select no specific collection in the BE there, only the album of the default language displayed on the FE-side of the default language.

    But then the albums of both languages ​​are displayed on the FE-side of the alternative language again?!

    When I use the "nested album view" in BE and select them the corresponding collections in BE, only the selected albums are displayed in FE! But for that I need no translation!!!

    If I set the "flat album view" in BE is the already mentioned problem !!!

    I prefer the "flat album view" to specific users to be able to display images ( specific albums). Here there is no specific collection in the BE can be selected - and the problem persists!

  6. Frans Saris repo owner

    Looks like you render FE in content _fallback mode but you didn't translate the records. If you're not using strict mode you need to make sure the location parent is set for the translated albums.

  7. Goarli reporter

    Hello Frans,

    You're absolutely right!

    I render FE in content _fallback mode, yes.

    I have - as shown in the picture sent along, forget to translate the original text.mistake.png

    Thank you and sorry

    Goarli

  8. Markus Mächler

    @franssaris I think the problem is the call to $this->setAlbumUidRestrictions(); in the MediaAlbumController for nestedListAction. By doing this the uid of the sys_file_collection record gets restricted to the uid of the default language. But in the same query is a condition that does not allow a record to be in the default language, thus you always get an empty result.

    A possible fix could be to change MediaAlbumRepository->findAll from:

    if ($this->albumUids !== []) {
        if ($this->useAlbumUidsAsExclude) {
            $query->matching($query->logicalNot($query->in('uid', $this->albumUids)));
        } else {
            $query->matching($query->in('uid', $this->albumUids));
        }
    }
    

    to

    if ($this->albumUids !== []) {
        if ($this->useAlbumUidsAsExclude) {
            $query->matching($query->logicalNot($query->in('uid', $this->albumUids)));
        } else {
            $query->matching($query->logicalOr([
                $query->in('uid', $this->albumUids),
                $query->in('l10n_parent', $this->albumUids),
            ]));
        }
    }
    

    The same fix should also be applied in other parts of the repository, but probably you can also think of another solution.

  9. Markus Mächler

    Also the following line in MediaAlbum should be changed from:

    $fileCollection = $this->fileCollectionRepository->findByUid($this->getUid());
    

    to:

    $fileCollection = $this->fileCollectionRepository->findByUid($this->_localizedUid);
    
  10. Log in to comment