i2pplus

Translating I2P+

I2P+ uses gettext PO files for all user-facing strings. Each module has a bundle-messages.cfg describing its source paths and a locale/ directory holding one messages_<lang>.po file per language.

Layout

Workflow

  1. Refresh the English templates with ant poupdate-source. Review the changed messages_en.po files for tagging errors in the Java source and revert files whose only changes are line-number shifts.
  2. Translate. Only fill msgstr in the non-English PO files. The English messages_en.po is the template - its msgstr entries must stay empty and the system falls back to msgid.
  3. Generate the bundles by running the build, or directly:

    tools/scripts/bundle-messages.sh --dir <module-dir>
    

    The script prints a translation coverage summary per language; pass --no-coverage to suppress it. Requires xgettext, msgfmt, and msgmerge on your PATH.

Bulk translation of many entries

For large runs, read the untranslated entries with polib and apply them in a batch:

import polib
po = polib.Pofile("apps/routerconsole/locale/messages_de.po")
untranslated = po.untranslated_entries()   # msgid list, in file order

Write the translations to a small trans_de.py file holding a t list, then loop entry.msgstr = t[i] and po.save(). Bash heredocs truncate silently on large datasets - write the data as a file instead. Helper scripts live in tools/scripts/: extract_untranslated.py, batch_translate.py.

Diagnostics

Rules