Page MenuHomeFreeBSD

[doc][tools] Add spell checking scripts
ClosedPublic

Authored by fernape on Oct 12 2021, 4:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:37 AM
Unknown Object (File)
Fri, Mar 29, 2:52 PM
Unknown Object (File)
Thu, Mar 28, 2:29 PM
Unknown Object (File)
Mar 12 2024, 11:31 PM
Unknown Object (File)
Mar 12 2024, 11:31 PM
Unknown Object (File)
Mar 9 2024, 8:15 AM
Unknown Object (File)
Mar 9 2024, 8:15 AM
Unknown Object (File)
Mar 9 2024, 8:15 AM
Subscribers
None

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
Lint Not Applicable
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.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
30–31

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.

38

exit 1 is better

tools/po_spellcheck.sh
30–31

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.

42

exit 1 is better

50–51

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.