Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to localize books in multiple languages #1306

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Commits on Sep 15, 2021

  1. Add language config section

    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    e4b443c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    24e6d6b View commit details
    Browse the repository at this point in the history
  3. Actually, don't change source root

    The book paths have to gracefully degrade to the default language if
    they aren't available.
    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    3049d9f View commit details
    Browse the repository at this point in the history
  4. Specify language for book in command line args

    - Add a [language] table to book.toml. Each key in the table defines a
    new language with `name` and `default` properties.
    - Changes the directory structure of localized books. If the [language]
    table exists, mdBook will now assume the src/ directory contains
    subdirectories named after the keys in [language]. The behavior is
    backwards-compatible if you don't specify [language].
    - Specify which language of book to build using the -l/--language
    argument to `mdbook build` and similar, or omit to use the default
    language.
    - Specify the default language by setting the `default` property to
    `true` in an entry in [language]. Exactly one language must have `default`
    set to `true` if the [language] table is defined.
    - Each language has its own SUMMARY.md. It can include links to files
    not in other translations. If a link in SUMMARY.md refers to a
    nonexistent file that is specified in the default language, the renderer
    will gracefully degrade the link to the default language's page. If it
    still doesn't exist, the config's `create_missing` option will be
    respected instead.
    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    96d9271 View commit details
    Browse the repository at this point in the history
  5. Build multiple books from localizations at once

    Changes how the `book` module loads books. Now it is possible to load
    all of the translations of a book and put them into a single output
    folder. If a book is generated this way, a menu will be created in the
    handlebars renderer for switching between languages.
    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    8869c2c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    85ab4d3 View commit details
    Browse the repository at this point in the history
  7. Redirect to a 404 page when serving translated

    We can't redirect in warp based on the URL, so redirect to the default
    language's 404 page instead.
    
    See: seanmonstar/warp#171
    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    282fdaa View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e17ce64 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5e223e0 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a042cfc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ee740ac View commit details
    Browse the repository at this point in the history
  12. Rewrite links in Markdown to point to fallback if missing in translation

    It will follow relative links to other pages and embedded images.
    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    c72ce18 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    98c3a04 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    8d1c086 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    09a8b66 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    5fed5e8 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    d6c27ab View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    92ec3dd View commit details
    Browse the repository at this point in the history
  19. [localization] rustfmt

    Ruin0x11 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    56e72a2 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2021

  1. Remove extra localization.md

    Ruin0x11 committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    9d8147c View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2022

  1. Merge remote-tracking branch 'upstream/master' into localization

    # Conflicts:
    #	.gitignore
    #	guide/src/en/cli/completions.md
    #	guide/src/en/format/images/rust-logo-blk.svg
    #	guide/src/en/format/markdown.md
    #	guide/src/en/misc/introduction.md
    #	src/renderer/html_handlebars/hbs_renderer.rs
    #	src/utils/mod.rs
    Ruin0x11 committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    7305e8c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e74fdb1 View commit details
    Browse the repository at this point in the history