I expected that the menu entries get translated and point to the corresponding translated pages.
However, even though the translation of the identifiers work, each menu item points to the language with the highest weight rather than the language indicated by the translation.
Is there a simpler way to fix the links to the correct language rather than copying the menu definition βunchangedβ in individual menus.<languageCode>.toml?
I am the person who reworked the menu content a few months ago. I went back to the test site I used during this process, and found that I had been using a multilingual, multihost setup. So, the documentation is incorrect.
I need to either (a) come up with a menu template for multilingual, single host setup where the menu entries in site configuration are not separated by language, or (b) rewrite a portion of the documentation.
In the interim, separate menu entries by language.
Thank you for the clarification. It looked to good to be trueβ¦
How could I approach this: loop through the translations of each menu entry (if I find these ) and pick the correct one� I myself would not mind some complexity here if I could get rid of some files for it.
Itβs possible, but in my view not worth the effort.
Getting the page itself isnβt too bad. You already have a page reference for the primary site, so query .AllTranslations for the page with .Language.Lang equal to the current pageβs .Language.Lang.
In the non-primary languages (sites), the .IsMenuCurrent and .HasMenuCurrent methods will fail, so youβll need to come up with alternatives, probably using the .Eq and .Ancestors methods.