po-pretty-format (PO007)#

A PO file is not formatted the way Odoo exports it.

What it does#

Checks that the file is formatted as Odoo (and polib) write it:

  1. entries sorted by msgid;

  2. lines wrapped at 78 columns;

  3. no msgstr identical to its msgid (outside i18n_extra).

Why is this bad?#

Every export by Odoo or Weblate reformats the file, which turns small translation changes into large, hard to review diffs.

Fix safety#

Safe: the file is rewritten as OCA’s po-pretty-format would write it.

Opt-in#

ALL does not include this check: OCA’s repositories all disable po-pretty-format in their oca-checks-po hook, as Odoo’s and Weblate’s exports never match its order. Enable it with select = ["ALL", "PO007"].