Skip to content

3.3.0

Choose a tag to compare

@magicsunday magicsunday released this 12 Oct 14:56
· 5 commits to main since this release
3.3.0
bd058bd

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-fuzzy clears the fuzzy entries of a messages.po whose source text only changed in punctuation or spacing, such as a swap between a dash and a middle dot. msgmerge marks such an entry fuzzy and msgfmt leaves 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 one msgmerge produces.

  • bin/write-translations writes 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 as AbstractCatalogueStructureTestCase. 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, msgattrib and msgmerge on 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.