Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add locale check script + CI job, that runs gettext check #12394

Closed
wants to merge 6 commits into from
Closed
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
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ jobs:
- name: Type check with mypy
run: mypy

locale-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
- name: Check locale files with gettext
run: make locale-check

docs-lint:
runs-on: ubuntu-latest

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PYTHON ?= python3
all: format style-check type-check doclinter test

.PHONY: check
check: style-check type-check doclinter
check: style-check type-check locale-check doclinter

.PHONY: clean
clean: clean
Expand Down Expand Up @@ -56,6 +56,10 @@ format:
type-check:
@mypy

.PHONY: locale-check
locale-check:
@$(MAKE) -C sphinx/locale check

.PHONY: doclinter
doclinter:
@sphinx-lint --enable all --disable triple-backticks --max-line-length 85 --sort-by filename,line \
Expand Down
11 changes: 11 additions & 0 deletions sphinx/locale/Makefile
picnixz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore locales that are known failures. See utils/babel_runner.py
IGNORED = ta
picnixz marked this conversation as resolved.
Show resolved Hide resolved
POFILES = $(wildcard */LC_MESSAGES/sphinx.po)
CHECK = $(POFILES:.po=.check)

.PHONY: check
check: $(filter-out $(IGNORED:=/LC_MESSAGES/sphinx.check),$(CHECK))

.PHONY: $(CHECK)
$(CHECK): %.check: %.po
msgfmt --check -o /dev/null $<