Closed KevCaz closed 3 years ago
Commit d59a13419b33085b8b6a44b54e602f848a20b234 introduces a R script that uses the slclang
field in the yaml-header of a web page to add flags as selectors to the desired langages (and a custom js script to select langage just as @ahasverus did). Currently, it works only under the following conditions:
lang
attributes should be used to assign a langage to the sectionsslclang
field are those used in flag-icon-cssLet's give a minimal working example of a .Rmd file that should be convert into a bilingual webpage:
---
title: "Your page"
slclang:
- us
- fr
---
```{r, echo=FALSE, results="asis", message=FALSE}
source("Rscripts/slcLang.R")
slcLang("index.Rmd")
```
### Section US {lang=us}
### Section FR {lang=fr}
There are currently a couple of drawbacks. For instance, if the field title
of yaml-header is used, the title won't be multi-lingual.
No need for this, hugo supports this https://gohugo.io/content-management/multilingual/ the main issue being doing the translation!!!
We all are french speaker (and we have a Brasilian guy on board), so I think it makes sense that some sections of our common website become bilingual. We have discussed about it today with @david-beauchesne who, by the way, needs such feature for another website. Note that @ahasverus has already done such thing for his web page; the site of YinHui Xie (the creator of the knitr package), which likely uses Rmarkdown, supports such feature.
I guess I can do something using a JS script and there are likely a bunch of solutions available on line. So if you think about a good strategy, please comment below!!