mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-12 23:48:27 +02:00
Diff translations on every PR (#2214)
This uses a new mode of `i18n-report` to summarise the differences in translations as an action on each PR.
This commit is contained in:
parent
19e0660505
commit
d1b82a8e5c
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@ -162,3 +162,27 @@ jobs:
|
||||
env:
|
||||
MDBOOK_BOOK__LANGUAGE: ${{ matrix.language }}
|
||||
run: mdbook test
|
||||
|
||||
po-diff:
|
||||
name: Translation diff
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Rust cache
|
||||
uses: ./.github/workflows/setup-rust-cache
|
||||
|
||||
- name: Install mdbook
|
||||
uses: ./.github/workflows/install-mdbook
|
||||
|
||||
- name: Copy latest version of translations
|
||||
run: cp -r po old-po
|
||||
|
||||
- name: Checkout base version
|
||||
run: git checkout ${{ github.event.pull_request.base.sha }}
|
||||
|
||||
- name: Translation diff
|
||||
run: i18n-report diff old-po/ po/ > $GITHUB_STEP_SUMMARY
|
||||
|
2
.github/workflows/install-mdbook/action.yml
vendored
2
.github/workflows/install-mdbook/action.yml
vendored
@ -29,7 +29,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: Install i18n-report
|
||||
run: cargo install i18n-report --locked --version 0.1.0
|
||||
run: cargo install i18n-report --locked --version 0.2.0
|
||||
shell: bash
|
||||
|
||||
- name: Install mdbook-exerciser
|
||||
|
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@ -55,14 +55,14 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Build translation report
|
||||
run: i18n-report book/html/translation-report.html po/*.po
|
||||
run: i18n-report report book/html/translation-report.html po/*.po
|
||||
|
||||
- name: Build synced translation report
|
||||
run: |
|
||||
cp -r po synced-po
|
||||
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' mdbook build -d synced-po
|
||||
for file in synced-po/*.po; do msgmerge --update $file synced-po/messages.pot ; done
|
||||
i18n-report book/html/synced-translation-report.html synced-po/*.po
|
||||
i18n-report report book/html/synced-translation-report.html synced-po/*.po
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
Loading…
Reference in New Issue
Block a user