Currently it is not possible to translate the Link entities. I've started working on a patch to enable that for multilingual sites.

Notes:
Core content translation framework doesn't support multiple url parameters in the canonical path. That results in breaking the add translations path.

What's working:
Field translations
Update for existing sites
Item entity title translation

Comments

kanei created an issue. See original summary.

mvantuch’s picture

Issue summary: View changes
mvantuch’s picture

Issue summary: View changes
StatusFileSize
new4.17 KB

First patch attached, further work will follow. I had to restructure the menu to remove the {colossal_manu} parameter from edit pages to allow the translations.

mvantuch’s picture

Issue summary: View changes
StatusFileSize
new6.91 KB
mvantuch’s picture

Assigned: mvantuch » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new10.33 KB

Seems like it's working now. Update went through fine and expected fields and properties can be translated as expected. UI could use a bit more polishing though, especially the breadcrumb.

grimreaper’s picture

Assigned: Unassigned » grimreaper
Status: Needs review » Needs work

Hello,

Thanks for the patch but the update fails. I will provide a new patch.

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review
StatusFileSize
new10.76 KB
new2.96 KB

Here is an updated patch. Thanks for the review.

grimreaper’s picture

Status: Needs review » Needs work

After the update when I switch the language I obtain a fatal error:

InvalidArgumentException: Invalid translation language (fr) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (line 783 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

And the field values (entity reference, long text, etc.) of some link types are lost.

mvantuch’s picture

Yep, sorry about that, should have written a warning about that. There's some weird issues with the data migration when it works fine on a clean installation but fails on an existing site. There will need to be more work and checking of why that happens.

apupiales’s picture

StatusFileSize
new8.23 KB

Hello.

I think there is not a clean way to update older colossal menu links without and independent migration process (using migrate or default content), it because this entity is fieldable and do it using direct queries to database could not be a generic solution for different implementations. Also it is not possible to get older field definitions once the entity is updated.

In the other hand, the error mentioned in #8 "InvalidArgumentException: Invalid translation language (fr) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (line 783 of core/lib/Drupal/Core/Entity/ContentEntityBase.php)." is generated in src/Menu/MenuLinkTree.php method createInstances because it assumes we allays have a translation but it is not necessary true, for this y add an additional validation in the attached patch

Thanks guys.

wells’s picture

Status: Needs work » Closed (outdated)

I'm going to close this as outdated. If someone wants to take this up again with a new patch plus target the 3.0.x branch. Thanks!