Page MenuHomeFreeBSD

[doc][tools] Add spell checking scripts
ClosedPublic

Authored by fernape on Oct 12 2021, 4:12 PM.

Details

Summary

Add two small scripts to do spell checking in .po files.

When working with Weblate, the web browser provides some spell checking with
visual hints for every translation entry.

These scripts provide spell checking for the whole file showing the faulting
words in context.

Relies on msgexec(1) and aspell(1) from devel/gettext-tools and
textproc/aspell.

Test Plan

It can be tested with:

./po_spellcheck.sh ../documentation/content/es/articles/bsdl-gpl/_index.po es

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 42086
Build 38974: arc lint + arc unit

Event Timeline

fernape created this revision.

Can you please add the license copyright in the header?

This revision now requires changes to proceed.Oct 12 2021, 4:31 PM

Can you please add the license copyright in the header?

Done.

Thanks!

Nice, thanks, for me it’s ok.
Can we wait to @dbaio?

This revision is now accepted and ready to land.Oct 12 2021, 5:07 PM

Nice, thanks, for me it’s ok.
Can we wait to @dbaio?

Absolutely. Thanks for the review!

dbaio requested changes to this revision.Oct 12 2021, 6:55 PM

Good idea Fernando.

Just a few points to check.

tools/po_check_entry.sh
29–30

Improve text here, example from documentation/Makefile:

${COMMAND} not found, please run 'pkg install aspell $your_lang-aspell

And use other exit code number, other than 0.

37

exit 1 is better

tools/po_spellcheck.sh
29–30

Improve text here, example from documentation/Makefile:

${COMMAND} not found, please run 'pkg install docproj

I let docproj because it includes po4a, which requires gettext-tools.

And use other exit code number, other than 0.

41

exit 1 is better

49–50

You can use dirname "$0" to get the full directory that po_spellcheck.sh was executed from, so we can call it from anywhere.

This revision now requires changes to proceed.Oct 12 2021, 6:55 PM

Address dbaio@ comments:

  • Use exit 1
  • Improve error messages
  • Allow invocation from everywhere

Thanks for the suggestions.

This revision is now accepted and ready to land.Oct 13 2021, 12:16 PM
This revision was automatically updated to reflect the committed changes.