1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-01 09:32:10 +02:00

Test that a no-op translation does nothing

This ensures that the full mdbook-xgettext and mdbook-gettext workflow
is stable and doesn’t include spurious newlines.
This commit is contained in:
Martin Geisler 2023-01-10 15:00:20 +01:00
parent c45bb19528
commit f42c76e6a8

View File

@ -44,6 +44,49 @@ jobs:
run: cargo test
working-directory: i18n-helpers
i18n-helpers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Gettext
run: sudo apt install gettext
- name: Install mdbook
run: cargo install mdbook --version 0.4.25
- name: Install mdbook-svgbob
run: cargo install mdbook-svgbob --version 0.2.1
- name: Install i18n-helpers
run: cargo install --path i18n-helpers --locked
- 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 -r expanded no-op
translations:
runs-on: ubuntu-latest
strategy: