Repository navigation
3.3.0
3.3.0 adds two shared tools for the translation catalogues of a module, so a module no longer needs a private script for either job. Existing code keeps working.
New
-
bin/resolve-fuzzyclears the fuzzy entries of amessages.powhose source text only changed in punctuation or spacing, such as a swap between a dash and a middle dot.msgmergemarks such an entry fuzzy andmsgfmtleaves it out of the compiled catalogue, so the English source shows instead of a translation that is still right. The same swap is applied to the translation. Every other fuzzy entry stays fuzzy and is listed for a person to judge, with its context in front when it has one. The gettext tools write the catalogue, so its layout stays the onemsgmergeproduces. -
bin/write-translationswrites the translations a module keeps in one JSON file into its catalogues, with the right number of plural forms for each locale. The form count comes from the plural rule webtrees uses, the same source asAbstractCatalogueStructureTestCase. Only an entry without a translation is written. Fuzzy entries, translated entries and the texts webtrees core translates itself (--core-owned=<file.pot>) are left alone. A list with the wrong number of forms, and a catalogue whose header declares another number of plural forms, are refused and named. A second run changes nothing.
Notes for consumers
- Both tools need
msgcat,msgattribandmsgmergeon the path. Composer installs them as binaries of this package. - A catalogue has to be what a merge with the template writes. One that is not is named and left as it is. To bring it into that layout, write it once with
msgmerge --previous --output-file=<new file> <catalogue> <template>and replace the catalogue with the new file. - Run as root in a container, a rewritten catalogue keeps its owner and group where the process may set them.
- The README and AGENTS.md describe both tools and their limits.