镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

translated vignette proposal : all pages link back to EN root vignette #6613

Open

Description

@ChristianWia

The EN vignette holds links towards translated pages (for example https://rdatatable.gitlab.io/data.table/articles/datatable-intro.html leads to FR transltion in -> https://rdatatable.gitlab.io/data.table/articles/fr/datatable-intro.html

In the translated page, there is no longer useful to reference the page itself, nor all other existing translations (for page maintenance reasons when new language is added)

So my proposal would be that all translated pages display the same equivalent of :

Translations of this document is available in

English

Activity

  1. rikivillalba commented on Nov 13, 2024

    @rikivillalba
    Contributor

    Some chunk could be provided that generate the link list, provided the corresponding files and directories exist
    I.e.

    ```{r echo = FALSE}
      url = "https://rdatatable.gitlab.io/data.table/articles"
      path = dirname(knitr::current_input(TRUE))
      if (basename(path) == "vignettes") {
        lang = "en"
      } else {
        lang = basename(path)
        path = dirname(path)
      }
    
      translation = dir(path,
        recursive = TRUE,
        pattern = glob2rx(knitr::current_input(FALSE))
      )
      transl_lang = ifelse(dirname(translation) == ".", "en", dirname(translation))
    
      block = sprintf("%s\n", paste(sprintf(
        " [%s](%s) ",
        transl_lang[transl_lang != lang],
        file.path(url, sub("(?i)\\.Rmd$", ".html", translation[transl_lang != lang]))
      )))
    
      knitr::asis_output(block)
    ``` #
    
  2. rikivillalba commented on Nov 13, 2024

    @rikivillalba
    Contributor

    Relevant: #6455

  3. tdhock commented on Nov 14, 2024

    @tdhock
    Member

    the idea of automatically generated links between languages is interesting, but where would you put that code? (to avoid duplicated logic in each vignette)

  4. rikivillalba commented on Nov 16, 2024

    @rikivillalba
    Contributor

    #6618 is my proposal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationtranslationissues/PRs related to message translation projects

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions