diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c496947fe4..da4dc233c8e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/Makefile b/Makefile index 54dd66dc888..a749a3492cf 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 \ diff --git a/sphinx/locale/Makefile b/sphinx/locale/Makefile new file mode 100644 index 00000000000..e158343fc5c --- /dev/null +++ b/sphinx/locale/Makefile @@ -0,0 +1,11 @@ +# Ignore locales that are known failures. See utils/babel_runner.py +IGNORED = ta +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 $<