The PDFs are committed to the repository and linked using GitHub raw-file URLs for direct access. To update them, rebuild the PDFs locally and commit the regenerated files.
Run these from the repository root:
pipenv installBuild the English PDF:
pipenv run sphinx-build -M latexpdf Technical_Report Technical_Report/_buildBuild the Spanish PDF:
$env:REPORT_LANGUAGE = "es"
pipenv run sphinx-build -M latexpdf Technical_Report Technical_Report/_build/es
Remove-Item Env:\REPORT_LANGUAGEIf MiKTeX reports that it is a fresh TeX installation after Sphinx writes the Spanish LaTeX files, finish the PDF from the generated .tex file:
Push-Location Technical_Report/_build/es/latex
xelatex -interaction=nonstopmode trinidad_es.tex
xelatex -interaction=nonstopmode trinidad_es.tex
Pop-LocationUse this sequence when you want to regenerate trinidad_es.pdf after text edits.
-
Regenerate gettext catalogs from the current
.rstsource:pipenv run sphinx-build -M gettext Technical_Report Technical_Report/_build/gettext
-
Merge updated catalogs into Spanish
.pofiles:$potDir='Technical_Report/_build/gettext/gettext' Get-ChildItem -Path $potDir -Filter *.pot | ForEach-Object { $domain=$_.BaseName pipenv run pybabel update -i $_.FullName -d Technical_Report/locale -D $domain -l es }
-
Apply translation + glossary to all entries (not only empty entries):
pipenv run python Technical_Report/translate_po_files.py --force
-
Validate for unresolved placeholders or broken RST roles:
pipenv run python Technical_Report/translate_po_files.py --check
-
Build Spanish with
REPORT_LANGUAGE=esand always clear the variable:$env:REPORT_LANGUAGE = "es" try { pipenv run sphinx-build -M latexpdf Technical_Report Technical_Report/_build/es } finally { Remove-Item Env:\REPORT_LANGUAGE -ErrorAction SilentlyContinue }
-
If the build stops after generating
trinidad_es.tex(common with first-time MiKTeX package setup), run XeLaTeX twice:Push-Location Technical_Report/_build/es/latex xelatex -interaction=nonstopmode trinidad_es.tex xelatex -interaction=nonstopmode trinidad_es.tex Pop-Location
-
Final Spanish PDF location:
Technical_Report/_build/es/latex/trinidad_es.pdf
- English PDF output is written to
Technical_Report/_build/latex/trinidad_en.pdf - Spanish PDF output is written to
Technical_Report/_build/es/latex/trinidad_es.pdf - The PDF builds require a working LaTeX toolchain installed on the system.
The Spanish translation source files are stored in Technical_Report/locale/es/LC_MESSAGES.
To check the translated .po files for broken reStructuredText roles or unresolved placeholders:
pipenv run python Technical_Report/translate_po_files.py --checkTo translate empty entries and retranslate entries with broken RST placeholders:
pipenv run python Technical_Report/translate_po_files.pyThe translation script uses googletrans and SpaCy. If the SpaCy models are not installed, install them with:
pipenv run python -m spacy download en_core_web_sm
pipenv run python -m spacy download es_core_news_lgThe Spanish PDF build command above uses the translated .po files without changing report.yaml permanently.
- Copy the technical report variable map from Onshape into
Technical_Report/plant.yaml. - Update the plant name, report titles, and Onshape URL in
Technical_Report/report.yaml. - Copy the plant image from Onshape to
Technical_Report/images/plant.png.