Drupal\menu_link_content\Plugin\Menu\MenuLinkContent currently has methods for retreiving the menu title and description for the menu item using getTitle() and getDescription(). In those methods we check if the site is multilingual and if it is, it returns the title of the underlying entity. However there is no way of fetching this info in a specific language, it is always returned in the current site language.
This becomes a problem for example in the Token module when it tries to batch generate path aliases based on the menu titles. This is done for all languages at once and needs to be able to fetch the title for specific translations. Currently we have implemented a workaround for this in #2787977: Pathauto bulk update for Multilingual Menu generates menu path for current site language.
Proposed solution:
Add a $langcode parameter to getTitle() and getDescription().
Comments
Comment #2
reekris commentedComment #3
reekris commentedComment #17
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #19
smustgrave commentedSince there's been no follow up in 10 years and was a feature request going to close out.
Thanks