|
44 | 44 | run: cargo test |
45 | 45 | working-directory: i18n-helpers |
46 | 46 |
|
| 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": {}}' |
| 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 | + |
47 | 90 | translations: |
48 | 91 | runs-on: ubuntu-latest |
49 | 92 | strategy: |
@@ -73,10 +116,10 @@ jobs: |
73 | 116 | run: cargo install --path i18n-helpers --locked |
74 | 117 |
|
75 | 118 | - name: Test ${{ matrix.language }} translation |
76 | | - run: msgfmt --statistics -o /dev/null po/${{ matrix.language }} |
| 119 | + run: msgfmt --statistics -o /dev/null po/${{ matrix.language }}.po |
77 | 120 |
|
78 | | - - name: Build course |
| 121 | + - name: Build course with ${{ matrix.language }} translation |
79 | 122 | run: mdbook build |
80 | 123 |
|
81 | | - - name: Test code snippets |
| 124 | + - name: Test code snippets with ${{ matrix.language }} translation |
82 | 125 | run: mdbook test |
0 commit comments