Add Spanish (es) translation - #951
Open
erdanieee wants to merge 2 commits into
Open
Conversation
Adds po/es.po covering all 2418 messages of the current template (interface strings, generator names and descriptions, edge descriptions, parameter labels, help texts and choice labels). Technical identifiers are deliberately kept as-is: single-letter edge codes, short section parameters (x, y, h, sx, ...), output formats and part numbers. Only the visible <option> labels are translated; the values submitted by the form stay unchanged. Where a parameter name and its own help text describe different quantities upstream, the label follows the help so that both agree on screen. For example --min_strength is documented as "strength of smallest wrench (in mm)", which is a thickness, so it is labelled "grosor mínimo" rather than "resistencia mínima".
The web interface discovers available languages by globbing locale/*/LC_MESSAGES/boxes.py.mo, so the compiled catalogue has to be committed alongside the .po file for Spanish to show up in the language selector. Same approach as the existing de, en, fr and zh_CN catalogues.
erdanieee
force-pushed
the
i18n-spanish
branch
from
August 10, 2026 14:05
7b98f97 to
0ea4e56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Spanish (
es) as a new interface language.Two files, matching how
franddewere added:po/es.polocale/es/LC_MESSAGES/boxes.py.moNo code changes are needed. Language discovery is entirely glob based —
BServer.getLanguages()globslocale/*/LC_MESSAGES/boxes.py.mo,setup.pyglobspo/*.po,MANIFEST.inalready coverspo/*, andBServer.lang_realready matches bothesandes-ES, soAccept-Language: es-ESresolves to this catalogue.The compiled
.mois committed becausegetLanguages()looks for.mofiles, not
.pofiles — without it the language never appears in theselector. This is also why the committed catalogue matters in the Docker
image:
setup.pyshells out withos.system(f"msgfmt {po} -o ...")without checking the return code, so on a machine without gettext the
build silently produces no catalogue at all.
Translation decisions
(
e,F,Š, …), short section parameters (x,y,h,sx,sh, …),output formats (
svg,dxf,lbrn2, …), pulley profiles (GT2_2mm,MXL, …)and pressure units (
Pa,mmHg, …).<option>labels are translated, never the values.arg2htmlemits
<option value="{e}">{_(e)}</option>, so form submission and theCLI keep working with the original English values.
quantities, the label follows the help, so the two agree on screen.
Example:
--min_strengthis documented as "strength of smallest wrench(in mm)", which is a thickness, so it is labelled grosor mínimo rather
than a literal resistencia mínima.
(Generar, Descargar, Guardar en la URL).
Notes for review
(
POT-Creation-Date: 2026-03-28). Generators added after that date —FrameLoom — are not covered yet and will be picked up the next time
po/boxes.py.potis regenerated..mowas compiled withpybabel compilerather thanmsgfmt, so itsheader carries
Generated-By: Babel 2.10.3. Regenerating it withmsgfmtproduces a functionally identical but byte-different file.
de,fr,zh_CNbehave the same), so nothing changes there.get_translation()does resolve correctly, so
LANGUAGE=esreachesbox.translations, whichis what
UBoxuses for its engraved part labels.Verification
/?language=esand/TypeTray?language=esrender in Spanish; the languageselector lists
esand marks it as selected (the directory name and thecatalogue's
Language:header match, which is what that comparison relies on).choice labels did not affect submitted values.
pytest— 194 passed, 9 skipped, including the byte-for-byteexamples/*.svgcomparison; the suite also passes withLANGUAGE=esset,so no translated string leaks into rendered output.
pre-commit run --files po/es.po locale/es/LC_MESSAGES/boxes.py.mo— clean.%s/%d, URL,image path, HTML tag and entity is preserved, and that no entry is marked
fuzzy.