tree: b0a83f534a7450267aebc6a8fc78c69b86e402bf [search]
  1. integrate/
  2. scripts/
  3. README.md
  4. TranslationAOO.odt
  5. TranslationAOO.pdf
  6. TranslationAOO_en-US.pdf
translation-scripts/README.md

OpenOffice translation scripts

Two sets of tools live here:

  • integrate/: what an OpenOffice developer runs to bring the translations in extras/l10n/source/<lang>/localize.sdf up to date. It needs no Pootle server.
  • scripts/: the scripts the Pootle server at translate.apache.org is run with, and scripts/en-US.sdf, the English strings of the current source.

The process as a whole, and its history, is on the wiki: Translation Process.

Updating the translations in the source tree

integrate/update_translations.py does in one command what the Pootle server and an integration round do together, for every language in the tree.

You need:

  • an OpenOffice checkout (the directory with main/ and extras/) in which l10ntools is built, for gsicheck. A full build is only needed for --extract, below.
  • Python 3.7 or later and git. The script installs translate-toolkit 2.2.5, the version the Pootle server runs, into a venv in its work directory, and clones the PO files from apache/openoffice-translation, only for the languages you ask for, unless you pass --po-repo.

Then:

cd ~/src      # the directory holding openoffice/ and openoffice-devtools/
python3 openoffice-devtools/translation-scripts/integrate/update_translations.py --aoo openoffice

This only reports, and keeps its work in ./aoo-l10n-work (--workdir to change it), outside the checkout. Read aoo-l10n-work/<run>/report.md: per language, the entries re-keyed, updated, added and left out, and the translated entries before and after. When it looks right, run again with --apply, check git diff --stat extras/l10n, and commit the changed localize.sdf files. A second run on the result reports no changes; if it does not, something is wrong.

Common options:

OptionUse
--langs de,fronly these languages (tree codes, pt-BR not pt_BR)
--mode update --history REV...also replace tree text with newer PO text, except text found in the given older openoffice-translation revisions (a Pootle rollback); needs the full history
--extractmake a fresh en-US.sdf from --aoo first; Linux, fully built tree
--save-templatewith --extract, write it over scripts/en-US.sdf; commit that too
--export-poalso write the updated PO files, as Pootle would offer them to translators
--po-repo DIR, --solver DIR, --python PYuse an existing checkout, gsicheck build or toolkit

When strings change in the source, refresh the template first: on a Linux build, run with --extract --save-template --apply, then commit scripts/en-US.sdf here and the tree files in OpenOffice. The tree files are re-keyed against the template, so the two must stay in step.

To check a result in a real build, configure a Linux tree with --with-lang="de ja" and compare the help in helpcontent2/<platform>/bin/xhp_*_<lang>.zip with a build of the unchanged files.

The individual tools (sdf_integrate.py rekey|combine|merge|gate and fix_msgctxt.py) and the reasons behind each step are described in integrate/README.md.

The Pootle server scripts

These run on the server, from a Python 2.7 virtualenv with Pootle 2.8.2, and use paths in the maintainer's home directory. They are kept here as the record of how the server works. In order:

ScriptStep
10_Download.shfetch en-US.sdf from the AOO42X nightly build
20_sdf2pot.shoo2po --pot into POT-UI/ and POT-HELP/; skips an empty file
25_sync-pot-files2db.shload the templates into Pootle (update_stores)
30_sync-db2files.shwrite each language from Pootle to PO files (sync_stores --overwrite)
40_pomerge.shpomerge each language against the new templates
50_sync-po-files2db.shload the merged PO files back (update_stores)
60_cp2home.shcopy the PO files into the git work directory, published as openoffice-translation
mksdf.shpo2oo per language, for integration

LanguageLists.sh holds the language lists the others read, mklangdirs.sh and reset-pootle.sh set up language directories and restore PO files after a bad template import, mnrun.sh is the nightly cron entry (all commented out here), and UpdateTranslation.sh and UpdateTranslation2.sh hold the same steps in one script (in the first most of them are commented out; the second asks whether the en-US.sdf it finds is a recent one). The unnumbered Download.sh, sdf2pot.sh, sync-*.sh, pomerge.sh and cp2home.sh are identical copies of the numbered ones. TranslationAOO.pdf is the maintainer's description of the server, in German. A translated TranslationAOO.pdf to English is later provided, as well as an editable .odt.

scripts/en-US.sdf is not fetched by these scripts. It is a trunk extract kept for integrate/. The nightly copy is empty: it is dated 2026-11-06, the day of the last AOO42X nightly build, which failed.