Page MenuHomeFreeBSD

[doc][tools] Add spell checking scripts
ClosedPublic

Authored by fernape on Tue, Oct 12, 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

fernape created this revision.

Can you please add the license copyright in the header?

This revision now requires changes to proceed.Tue, Oct 12, 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.Tue, Oct 12, 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.Tue, Oct 12, 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.Tue, Oct 12, 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.Wed, Oct 13, 12:16 PM
This revision was automatically updated to reflect the committed changes.