pbs-assess / herringsr

:paperclip: :fish: Herring Science Response document
0 stars 1 forks source link

Select English or French files in "_bookdown.yml" based on `french` YAML parameter #61

Open grinnellm opened 4 years ago

grinnellm commented 4 years ago

Use the french: false or french: true to bring in the proper Section files (e.g., "english/01_context.Rmd" or "french/01_context.Rmd"). Could possible be done one of two ways, maybe using an ifelse command:

  1. Have a different "_bookdown_yml" file for each language and select the proper one, or
  2. Having different lines in the "_bookdown.yml" file that load either the English files, or the French files.
cgrandin commented 4 years ago

FYI - I re-wrote the whole techreport example last month and all the French/English conversion details you need to know are in there. I just mention it here so everyone knows about it.

The switch for English/French is in index.Rmd.

To make the final French version of the document, I would recommend the following as it is by far the simplest way. It's the way I will be doing it anyway:

  1. Once you receive all the translations back for a doc, create a branch called '2019french' or something so you know which year it was. Switch to that branch. Push it to Github so it stays in the repo forever.
  2. Copy/paste all the french text in, deleting all the English.
  3. Set the switch to french:true in index.Rmd. This will make all the figures, tables, and all the captions french.
  4. Once done and built the final version just switch back to master. Leave the branch on Github for future reference.

The other ways you suggest Matt would require more work in trying to figure out how to change _bookdown files, etc. and whole lot more coding in general. This way just involves cutting and pasting text.