yari
yari copied to clipboard
Is it possible to show locale title instead of the last path string in `main menu of module` for macros?
Related to https://github.com/mdn/translated-content/issues/13881.
Our main menus of module display the last path string:
https://github.com/mdn/yari/blob/6b54c603da801cd0abbef4cbdf475084aa146960/kumascript/macros/PreviousMenuNext.ejs#L46-L51
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?
ping @yin1999 for ideas :)
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.