You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-23 09:16:44 +02:00
Use mdbook-i18n-helpers crate (#552)
The i18n-helpers are now available as a stand-alone crate: https://crates.io/crates/mdbook-i18n-helpers. Because we cache the Rust binaries in our GitHub workflows, I bumped the cache prefix to ensure we use a clean cache. Otherwise, Cargo won’t install the new binaries in mdbook-i18n-helpers because it sees the old ones from this repository.
This commit is contained in:
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@ -86,43 +86,6 @@ jobs:
|
||||
working-directory: ${{ matrix.directory }}
|
||||
run: cargo build
|
||||
|
||||
i18n-helpers:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Rust cache
|
||||
uses: ./.github/workflows/setup-rust-cache
|
||||
|
||||
- name: Install Gettext
|
||||
run: sudo apt install gettext
|
||||
|
||||
- name: Install mdbook
|
||||
uses: ./.github/workflows/install-mdbook
|
||||
|
||||
- name: Generate po/messages.pot
|
||||
run: mdbook build -d po
|
||||
env:
|
||||
MDBOOK_OUTPUT: '{"xgettext": {"pot-file": "messages.pot"}}'
|
||||
|
||||
- name: Test messages.pot
|
||||
run: msgfmt --statistics -o /dev/null po/messages.pot
|
||||
|
||||
- name: Expand includes without translation
|
||||
run: mdbook build -d expanded
|
||||
env:
|
||||
MDBOOK_OUTPUT: '{"markdown": {}}'
|
||||
|
||||
- name: Expand includes with no-op translation
|
||||
run: mdbook build -d no-op
|
||||
env:
|
||||
MDBOOK_OUTPUT: '{"markdown": {}}'
|
||||
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/messages.pot
|
||||
|
||||
- name: Compare no translation to no-op translation
|
||||
run: diff --color=always --unified --recursive expanded no-op
|
||||
|
||||
find-translations:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
|
6
.github/workflows/install-mdbook/action.yml
vendored
6
.github/workflows/install-mdbook/action.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: Install mdbook and dependencies
|
||||
|
||||
description: Install the mdbook with the dependencies we need.
|
||||
description: Install mdbook with the dependencies we need.
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@ -15,6 +15,6 @@ runs:
|
||||
run: cargo install mdbook-svgbob --locked --version 0.2.1
|
||||
shell: bash
|
||||
|
||||
- name: Install i18n-helpers
|
||||
run: cargo install --path i18n-helpers --locked
|
||||
- name: Install mdbook-i18n-helpers
|
||||
run: cargo install mdbook-i18n-helpers --locked --version 0.1.0
|
||||
shell: bash
|
||||
|
@ -7,3 +7,5 @@ runs:
|
||||
steps:
|
||||
- name: Setup Rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
prefix-key: v1 # Remove after merging #1322.
|
||||
|
Reference in New Issue
Block a user