Skip to Content
Browse documentation

Create and Compile Translations

Edit gettext PO catalogs, preserve placeholders and plural forms, and use the Eenos translate tool for rebuild, base and compile operations.

Work on backed-up catalogs on a development server. The installed /usr/local/eenos/scripts/translate command accepts one operation and exactly one panel selector.

Inspect configured codes

/usr/local/eenos/scripts/translate --list --wap
/usr/local/eenos/scripts/translate --list --rapp
/usr/local/eenos/scripts/translate --list --uapp

These list settings; they do not measure translated-string coverage.

Rebuild or refresh catalogs deliberately

/usr/local/eenos/scripts/translate --rebuild --wap

Replace --wap with --rapp or --uapp for a separate invocation. The current rebuild extracts frontend and backend messages, stages frontend/backend catalogs and merges them into the panel locale tree. Existing catalogs and intermediate locale.fe/locale.be directories can be rewritten or removed. Review the resulting diff and extraction logs; do not treat rebuilding as an automatic translation service.

For an English-only base rebuild:

/usr/local/eenos/scripts/translate --base --wap

The current base workflow extracts English from temporary source copies, merges the catalogs and replaces the selected panel's English django.po. It leaves other locale catalogs intact, but still overwrites that English catalog. It does not compile MO files automatically.

Translate PO entries

Keep msgid as the source message and put the translation in msgstr. Preserve interpolation names, formatting tokens, HTML structure and escaping. Maintain valid language headers and language-specific plural rules; do not copy another language's plural formula without review.

msgid "Save Settings"
msgstr "Guardar configuración"

This is a Spanish example, not text to paste into an Arabic or other-language catalog. Review fuzzy and untranslated entries and context/plural forms using a gettext-aware editor.

Validate and compile

For an offline edited file, GNU gettext can check syntax and formatting:

msgfmt --check --check-format -o /dev/null /path/to/reviewed/django.po

Then intentionally compile the chosen panel's catalogs:

/usr/local/eenos/scripts/translate --compile --wap

Compilation uses Django compilemessages for the selected panel working directory and can overwrite existing MO files. GNU gettext/Django tools must be available. Inspect errors and compiled output; the wrapper's final message or exit status alone is not sufficient evidence of success.

Verify and maintain

Confirm the selected language in a fresh panel session and check navigation, forms, validation errors, plural messages and right-to-left layout where applicable. Arrange any required worker reload through your normal deployment process if cached translations remain in use. Keep the previous PO/MO pair for rollback.

Repeat extraction/review after panel updates so new source messages do not remain untranslated. See the translate command reference for exact flags.