Repository navigation
3.1.0
3.1.0 adds a shared test case that locks the structure of the translation catalogues a webtrees module ships. Nothing else changes, existing code keeps working.
New
-
Testing\AbstractCatalogueStructureTestCaseis an abstract PHPUnit case. A module extends it in its owntests/and implementslanguageDirectory(), the directory with one subdirectory per locale that holdsmessages.poand its compiledmessages.mo.webtrees merges the compiled catalogue of a module over its own, so a plural entry with the wrong number of forms or an empty form damages the translation of the same text everywhere in the installation. The case guards against that:
- the form count of every compiled plural entry against the plural rule class of the locale, never against the PO header
- the slot count of the source catalogue, including entries the compiler drops
- empty forms
- the
%sand%dplaceholders, numbered ones included. Unnumbered placeholders keep their order, numbered ones may change position. - the compiled catalogue against its source
- a complete
Plural-Formsheader line - a render of every plural entry for a range of numbers
A subclass needs
#[CoversNothing]when itsphpunit.xmlsetsrequireCoverageMetadata.
Notes for consumers
- The class ships with the library but extends
PHPUnit\Framework\TestCase, so it is only loaded when a module extends it. PHPUnit is asuggest, not a requirement. - The case sits in its own deptrac layer that depends on no other
src/code. - Modules that carry their own copy of these checks can replace it with a subclass that names the catalogue directory.