Skip to content

Create current_lang and compile the catalogs in conf.py, not in the Makefile - #1763

Merged
jpmckinney merged 3 commits into
1.1-devfrom
current-lang-1.1
Oct 9, 2026
Merged

jpmckinney merged 3 commits into
1.1-devfrom
current-lang-1.1

Conversation

@jpmckinney

Copy link
Copy Markdown
Member

Moves two Make targets into docs/conf.py, for phase 2 of open-contracting/deploy#266 (comment): the build becomes plain sphinx-build, runnable on any CI or host.

This is now blocking. standard_profile_template@latest has already dropped both targets from include/common.mk, so the next script/update here would pull a common.mk with no current_lang target while conf.py has no replacement — and 23 files refer to build/current_lang, so the build would fail.

  • current_lang. A symlink so that build/current_lang paths in directives resolve to the language being built. setup() already writes into build/<language>/, so it creates the symlink beside it and removes it on build-finished.
  • compile. config.mk ran pybabel compile for every language up front. conf.py compiles only the language being built, and only the domains translate reads. That empties the hook, so common.mk drops it and config.mk drops the target — one mechanism instead of two.

English is the source language and has no catalogs, so the call is guarded with if language != "en", matching the default on the line that sets language. The guard is deliberately at the call site rather than inside the helper: a translated language missing a catalog is an error, and now fails loudly. Verified by deleting docs/locale/es — the Spanish build stops with FileNotFoundError: .../es/LC_MESSAGES/schema.po, where a path.is_file() guard inside the helper would have silently shipped untranslated pages.

include/common.mk is synced from standard_profile_template and is byte-identical to it and to the six other documentation repositories.

Verified

make source, es and fr all pass under -nW, producing 56 pages per language, with no build/current_lang left behind.

compile_catalogs was checked differentially, not by deleting .mo files — that proves nothing, because Sphinx's gettext_auto_build recompiles them. With it, the Spanish schema reference renders 4 translated strings; without it, 0.

🤖 Generated with Claude Code

jpmckinney and others added 3 commits October 9, 2026 10:44
`setup()` already writes into `build/<language>/`, so it can create the symlink beside it, and remove it once the
build finishes. This drops the Make prerequisite from every build, extract and linkcheck target.

include/common.mk is synced from standard_profile_template, where the same change is on the `current-lang` branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
(cherry picked from commit a24d2b192c40648b0e40bc113fe9cb68a5d32856)
(cherry picked from commit f83e559f9769b9738d1a4b69bfd56a3b64a3974f)
…he Makefile

`setup()` already reads the compiled catalogs through `translate`, and knows which language is being built, so it
can compile that language's catalogs first. The Makefile compiled every language's up front.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
(cherry picked from commit 2437a3b43408225ae87a6e5c2a1a3053c85afc70)
(cherry picked from commit 9330aaed88020d6a7f21ccd035a938edcb92835f)
include/common.mk is synced from standard_profile_template, where the same change is on the
`current-lang` branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
@jpmckinney jpmckinney added this to the Minor: Build changes milestone Oct 9, 2026
@jpmckinney
jpmckinney merged commit 7876f2d into 1.1-dev Oct 9, 2026
11 checks passed
@jpmckinney
jpmckinney deleted the current-lang-1.1 branch October 9, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant