Replies: 2 comments 4 replies
-
Would you mind sharing a small Git repository with the setup and highlight the part that does not work? |
Beta Was this translation helpful? Give feedback.
-
Since the second issue can be manually resolved -- by simply listing all the individual pages in the sidebar navigation in the correct order without the auto option -- I changed the above-mentioned repository to only feature the first issue of translating listing categories with profiles. See the screenshots below for the problem. I understand from issue # 5578 that there is no simple solution but I still wonder if there is any undocumented workaround. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We have used Quarto project profiles to create a relatively complex bilingual website, and for the most part this has worked very well. We use language-specific metadata files (e.g. _metadata-fr.yml) which are called in the profile yaml (_quarto-fr.yml) for document metadata such as page titles, and then we create language-specific versions of any given page from the same .qmd file by including profile content with:
I have two questions about functionality that we could not accomplish with profiles.
First, we are not able to translate listing categories. We were able to translate certain parts of the categories sidebar with _language.yml, but not the categories which we defined. I thought it should be possible to assign categories in the language-specific metadata files and then include them in the .qmd frontmatter with shortcodes but the category sidebar shows the shortcodes themselves rather than the categories (similar to this issue except that we use meta rather than var shortcodes: #5578 (comment)). Is there another possible approach for translating listing categories?
Second, we have a sidebar for country pages which we would like to order alphabetically for the language shown. The items included in the sidebar are created automatically from the .qmd files in specific folders, and because these .qmd files have the English country names in their file names, they get sorted correctly in the sidebar for the English site. But we create the French versions of these pages from the same .qmd files, and the French sidebar has the translated country names (from _metadata-fr.yml) but in the order of the English names.
I am aware of the 'order' option which can be supplied in the document frontmatter, but again I would need to read this from profile metadata with a shortcode, and I have not been able to make this work. Here is a sample error message:
Both of these issues may be because I don't know enough about how and when shortcodes work. It seems that they only work in document frontmatter when in quotation marks -- I also tried without -- but then yaml interprets their content as character strings, which doesn't work for all options. Is there documentation on which metadata fields can use shortcodes?
Thank you for any pointers you may be able to provide.
Quarto version: 1.3.450
OS: macOS 14.3
Beta Was this translation helpful? Give feedback.
All reactions