Skip to content

Repository files navigation

Trinidad report build

PDFs

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.

Build commands

Run these from the repository root:

pipenv install

Build the English PDF:

pipenv run sphinx-build -M latexpdf Technical_Report Technical_Report/_build

Build the Spanish PDF:

$env:REPORT_LANGUAGE = "es"
pipenv run sphinx-build -M latexpdf Technical_Report Technical_Report/_build/es
Remove-Item Env:\REPORT_LANGUAGE

If 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-Location

Spanish PDF build workflow (detailed)

Use this sequence when you want to regenerate trinidad_es.pdf after text edits.

  1. Regenerate gettext catalogs from the current .rst source:

    pipenv run sphinx-build -M gettext Technical_Report Technical_Report/_build/gettext
  2. Merge updated catalogs into Spanish .po files:

    $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
    }
  3. Apply translation + glossary to all entries (not only empty entries):

    pipenv run python Technical_Report/translate_po_files.py --force
  4. Validate for unresolved placeholders or broken RST roles:

    pipenv run python Technical_Report/translate_po_files.py --check
  5. Build Spanish with REPORT_LANGUAGE=es and 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
    }
  6. 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
  7. 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.

Spanish translation

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 --check

To translate empty entries and retranslate entries with broken RST placeholders:

pipenv run python Technical_Report/translate_po_files.py

The 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_lg

The Spanish PDF build command above uses the translated .po files without changing report.yaml permanently.

Data setup

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

About

memoria tecnica for the Trinidad, Departamento de Copan, Honduras

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages