Skip to content

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

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

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

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 27 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.

The same three commits as #1763, cherry-picked onto 1.2-dev so that 1.2 doesn't ship without them. #1763 is the one that reaches the live documentation.

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 63 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 3 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)
…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)
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 ba20a05 into 1.2-dev Oct 9, 2026
24 checks passed
@jpmckinney
jpmckinney deleted the current-lang-1.2 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