Is it possible to show locale title instead of the last path string in `main menu of module` for macros?
awxiaoxian2020 opened this issue · comments
Xavi Lee commented
Related to mdn/translated-content#13881.
Our main menus of module display the last path string:
yari/kumascript/macros/PreviousMenuNext.ejs
Lines 46 to 51 in 6b54c60
In locale, we only can only see the English title (i.e. the last past string):
Is it possible to show locale title instead of the last path string?
A1lo commented
Displaying localized titles would be better. I'm trying to embed localized titles into the page info in the macro system (#8241). But before this could be landed, we can only implement this in the following way:
- generate the full, localized slug with the
env.locale
variable - call
getPageByURL
method to get the page info, if the page does not exist, fallback to the en-US title, else use the title field in the returned object.