Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,48 @@ concurrency:
cancel-in-progress: true

jobs:
pot-freshness:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Babel
run: pip install -r l10n/requirements-l10n.txt
- name: Verify messages.pot is up to date
run: |
cp l10n/messages.pot l10n/messages.pot.before
python setup.py extract_messages
# Strip POT-Creation-Date from both files before comparing — Babel
# always writes the current timestamp, which would cause a false diff.
sed -i '/^"POT-Creation-Date:/d' l10n/messages.pot.before l10n/messages.pot
diff l10n/messages.pot.before l10n/messages.pot || \
(echo "::error::l10n/messages.pot is out of date. Run 'python setup.py extract_messages' and commit the result." && exit 1)

mo-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Babel
run: pip install -r l10n/requirements-l10n.txt
- name: Verify .mo files are up to date
run: |
python setup.py compile_catalog
# Warn but don't fail — ca and nl currently have stale .mo files.
# TODO: change to 'exit 1' once the translations submodule is fixed.
git -C src/seedsigner/resources/seedsigner-translations diff --exit-code || \
echo "::warning::Compiled .mo files are out of date. Run 'python setup.py compile_catalog' and commit the results to the seedsigner-translations submodule."

test:
runs-on: ubuntu-latest
strategy:
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing to SeedSigner

## Localization

SeedSigner uses [Babel](https://babel.pocoo.org/) to extract translatable strings into `l10n/messages.pot`. If you add or change any string wrapped with `_()`, `_mft()`, or `ButtonOption()`, you must regenerate the `.pot` file before pushing:

```bash
pip install -r l10n/requirements-l10n.txt # one-time setup
python setup.py extract_messages
```

CI will fail if `l10n/messages.pot` is out of date.

For more details on the three translation wrapping techniques and the full localization workflow, see `l10n/README.md`.