Skip to content

Commit ee4e2f2

Browse files
committed
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.
1 parent d3d934f commit ee4e2f2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/build.yml

+43
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,49 @@ jobs:
4444
run: cargo test
4545
working-directory: i18n-helpers
4646

47+
i18n-helpers:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
53+
- name: Setup Rust cache
54+
uses: Swatinem/rust-cache@v2
55+
56+
- name: Install Gettext
57+
run: sudo apt install gettext
58+
59+
- name: Install mdbook
60+
run: cargo install mdbook --version 0.4.25
61+
62+
- name: Install mdbook-svgbob
63+
run: cargo install mdbook-svgbob --version 0.2.1
64+
65+
- name: Install i18n-helpers
66+
run: cargo install --path i18n-helpers --locked
67+
68+
- name: Generate po/messages.pot
69+
run: mdbook build -d po
70+
env:
71+
MDBOOK_OUTPUT: '{"xgettext": {"pot-file": "messages.pot"}}'
72+
73+
- name: Test messages.pot
74+
run: msgfmt --statistics -o /dev/null po/messages.pot
75+
76+
- name: Expand includes without translation
77+
run: mdbook build -d expanded
78+
env:
79+
MDBOOK_OUTPUT: '{"markdown": {}}'
80+
81+
- name: Expand includes with no-op translation
82+
run: mdbook build -d no-op
83+
env:
84+
MDBOOK_OUTPUT: '{"markdown": {}}'
85+
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/messages.pot
86+
87+
- name: Compare no translation to no-op translation
88+
run: diff -r expanded no-op
89+
4790
translations:
4891
runs-on: ubuntu-latest
4992
strategy:

0 commit comments

Comments
 (0)