yari icon indicating copy to clipboard operation
yari copied to clipboard

Is it possible to show locale title instead of the last path string in `main menu of module` for macros?

Open awxiaoxian2020 opened this issue 1 year ago • 2 comments

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): image

Is it possible to show locale title instead of the last path string?

awxiaoxian2020 avatar Jan 06 '24 01:01 awxiaoxian2020

ping @yin1999 for ideas :)

awxiaoxian2020 avatar Jan 06 '24 01:01 awxiaoxian2020

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:

  1. generate the full, localized slug with the env.locale variable
  2. 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.

yin1999 avatar Jan 06 '24 01:01 yin1999