bookdown icon indicating copy to clipboard operation
bookdown copied to clipboard

Feature: Allow for translations of books and provide icon to switch between them

Open MavropaliasG opened this issue 5 years ago • 5 comments
trafficstars

I would love to see this as a figure of bookdown. It would help a LOT of projects, and allow technical books to be easier to understand by people in their native language.

An icon at the top like the ones you already have image that would serve for different language versions of the Rmd files would be absolutely fantastic!


By filing an issue to this repo, I promise that

  • [X] I have fully read the issue guide at https://yihui.org/issue/.
  • [X] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('bookdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/bookdown').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • [X] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

MavropaliasG avatar Oct 05 '20 07:10 MavropaliasG

For reference, this follow a discussion here : https://community.rstudio.com/t/providing-translations-for-r-bookdown-project/81536/5?u=cderv

@MavropaliasG, can you precise how you currently structure your bookdown project ? Do you have several source folder containing the Rmd with different language ? or do you have several bookdown projects ? Or other ?

Thank you

cderv avatar Oct 05 '20 09:10 cderv

I am in the process of writing a book in English, and just thinking of translating to other languages should it be successful. But even if mine isn't, I bet a lot of technical books in Rmarkdown + bookdown will be, and will require translation. Just imagine if the bookdown guide could be translated, to lower the barrier to entry for people who are not proficient in English!

Having said that, I do admit it's tricky to think of a way to approach this. My personal bookdown project has separate Rmd files for each chapter, very similar to how the example bookdown project is structured.

To prevent having separate folders with the same Rmd files in each folder, but translated (as someone would have to post the same changes in other elements, e.g. graphs or equations in every folder, which would take quite a bit of time), could having a code chunk containing the text be a solution? The code chunk would have a specific 'attribute' (like R code has 'r) to denote running text, and 'chunk ID', so that others can contribute translations that are linked to the ID, using tools like Weblate. Then, when users switch a language, the same Rmd file will contain the 'chunks' of text in another language and just replace the previous text with the new.

This 'code chunk as text container' approach might be overcomplicating it, and just having different folders for each language with the same set of Rmd files only in different languages might be a better solution? I know this is tricky problem, but I opened this feature request to get people to brainstorm ideas.

MavropaliasG avatar Oct 05 '20 10:10 MavropaliasG

@MavropaliasG Thanks for the feature request! I am curious if your use case for multilingual books is primarily for the HTML output format (i.e., gitbook or bs4_book)?

apreshill avatar Mar 29 '21 11:03 apreshill

Hi @apreshill thank you for the reply. My specific usecase would be a gitbook like https://bookdown.org/yihui/bookdown/

MavropaliasG avatar Mar 29 '21 12:03 MavropaliasG

A small prototype https://github.com/maelle/multilingual-book for HTML books built with bs4_book()

maelle avatar Oct 21 '21 13:10 maelle