Problem

In #2047633: Move definition of menu links to hook_menu_link_defaults(), decouple key name from path, and make 'parent' explicit, the original goal was to remove runtime translation support entirely from the menu system, the reason being custom created menu items will need to use the entity translation system for menu items anyway, so there is little point in using a separate translation system for shipped menu items. Although that issue did not end up removing translatability from menu items, that is still the overall plan in related issues.

Proposed solution

To make shipped menu item translation work, there are several things to make work though:

1. Entity translation for menu item properties needs to work. #1966398: [PP-1] Refactor menu link properties to multilingual.
2. For that, menu items need to be using the new entity system: #1842858: [PP-1] Convert menu links to the new Entity Field API
3. ... there are several layers of issues under there to make work.

This makes a base system available to translate menu items. We still need:

4. Localize.drupal.org to parse default/shipped menu items for translatable strings. Issue TBD (in potx module)
5. Locale module will pull the translations to the locale tables then. The next step is to build a translation sync tool between locale module and the menu entities. Configuration has such a sync system in language and locale modules. Whenever a shipped config translation is updated in locale, the config translation file is updated too. We need a similar system for content entities where the content entity translation syncs back to locale and a locale update/translation import would sync back to the content entities. Once/if the content entities are "forked", we should not keep syncing the translations though. (There is somewhat of a solution for that too in config).

Fun stuff, eh? :)

Comments

effulgentsia’s picture

Priority: Critical » Major

From #2256497-28: [meta] Menu Links - New Plan for the Homestretch by Dries:

While the current menu link system implementation (neither a ConfigEntity nor a ContentEntity) isn’t pretty, and would require a contrib module to support translating custom link titles and integrating with REST, that is not a regression compared to Drupal 7... We can live with those limitations for one release.

Therefore, downgrading this to Major. It would still be great for it to happen; just not a release blocker.

effulgentsia’s picture

See, however, #2265847: [PP-0.5] Regression from D7: default titles of customized menu links aren't translated for a critical issue that would need to be solved even if this one isn't.

Berdir’s picture

I don't think this is specific to custom menu links? The issue summary talks about them, but that's under the assumption that everything will be menu link entities I think, so it was required to have them translatable to support module-provided links...

#1966398: [PP-1] Refactor menu link properties to multilingual would be a about user provided menu links, and I think we already started doing tests with translatable menu links there which we can do as it's a completely new API anyway I think, so if it's translatable out the box,

this is more about the replacement for 'title' => 'My translatable title' in hook_menu(), which is IMHO pretty crucial? It might "just work" with the plugin-based approach, I don't know, but we should still keep track of it?

Or maybe I didn't understand it correctly, but shipped translations is/was afaik about translations for those...

(wrote this before your second comment)

pwolanin’s picture

I think this issue was predicated on the current state of HEAD + entity conversion, which is that all menu links are some kind of content entity.

If we finish #2256497: [meta] Menu Links - New Plan for the Homestretch then I think this becomes a general problem to discuss, but no longer really relevant to menu links.

So, either this issue is now postponed or duplicate, or should shift to a general discussion of packaged translation of default content?

dawehner’s picture

Can we mark this issue as fixed now?

Gábor Hojtsy’s picture

Status: Active » Closed (duplicate)

Yes, we resolved this by not using content entities for module provided items and still using content entities for custom. Indeed resolved.