Skip to content

Multilingual websites #2258

Open
Open

Description

@Bisaloo

Hi,

I'd like with this issue start a conversation about supporting pkgdown websites in multiple languages side-by-side. Last year, pkgdown has started to translate all the text it generates, making it easier to provide pkgdown website in languages other than English.

But providing documentation in more than one language remains challenging. Current attempts that I'm aware of hack their way around it by twisting the mode feature. It remains imperfect because the resulting sitemap is incomplete and language can't be automatically selected based on browser standard mechanisms.

Multilingual websites are available in other documentation generators such as mkdocs or readthedocs.

Here is some steps summarizing how multilingual sites could be achieved in pkgdown:

There should also be a mechanism to automatically detect which version of the README / vignettes should be rendered based on the value of lang. Other tools use a mechanism based on the detection of .fr.md, .es.md, etc. file extensions.

I've been considering whether this should be in pkgdown, or as an extension package but I became convinced it should be part of the main package because it will likely need to re-use some pkgdown internals, especially to create the modified sitemap.

I'm also not sure if all of this should be configured in _pkgdown.yml or if users who want a multilingual website should call a separate build_multilingual_site() wrapper function.

Activity

  1. added
    feature
    on May 10, 2024
  2. danalvarez commented on Apr 12, 2025

    @danalvarez

    Unfortunate that this got no more attention :( It would be extremely useful for us, we are working on an R package for a multilingual NGO.

  3. joelnitta commented on Nov 5, 2026

    @joelnitta

    One workaround that has become available since the OP is to use {pkgsite} (package website builder that uses Quarto) plus {babelquarto} (i18n package for Quarto).

    For example: https://joelnitta.github.io/citezot/

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

    featuretranslation 🌏

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions