Page MenuHomeFreeBSD

[docs] tools/translate.sh: Add fixups
ClosedPublic

Authored by fernape on Wed, Sep 8, 3:48 PM.

Details

Summary

Add fixups for several chores we needed to do by hand.

  • Fix tags: and trademarks: lists
  • Fix paths to point to the concerned language and not to master (articles only)
Test Plan

Before this patch, running po4translate via translate.sh will overwrite
includes and sourround tags and trademarks lists with single quotes. Running
git diff confirms this.

With this sed substitutions those changes are overwritten again by the script
so they restore the language-specific includes and such

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.
dbaio requested changes to this revision.Thu, Sep 9, 12:12 AM

Good idea, thanks for this Fernando.

Let's improve this for matching many includes as we can.

tools/translate.sh
3–5

Add your info here.

26–30

Please, change this comment to something like this:

# This is a temporary fix for po4a-translate command
# po4a: Fix YAML Front Matter / tags and trademarks
# https://wiki.freebsd.org/Doc/IdeaList#Translation
# $1: Fix to fix
36–41

In a few cases you mean?

42–51

Probably this can be used for all .adoc files, including books.
Will need to add another sed's.
So, you can rename the function name to fixup_includes() if you are ok with it.

I can help testing documentation pt-br, here are some examples:

-:chapters-path: content/pt-br/books/fdp-primer/
+:chapters-path: content/en/books/fdp-primer/

-include::content/pt-br/books/fdp-primer/toc.adoc[]
+include::content/en/books/fdp-primer/toc.adoc[]
This revision now requires changes to proceed.Thu, Sep 9, 12:12 AM
tools/translate.sh
26–30

File to fix*

Adopt Danilo's suggestions.

  • Add my contact info so I can be blamed properly
  • Improve comments
  • Apply susbtitutions in books too
  • Add some additional substitutions
fernape added inline comments.
tools/translate.sh
36–41

Yes in my mind was "most cases" for just the couple of articles I translated :-)

42–51

fixup_includes is now run unconditionally. Will you give it a try?

@fernape I've just tested... it's great.
Thanks again.

This revision is now accepted and ready to land.Thu, Sep 9, 8:27 PM
This revision was automatically updated to reflect the committed changes.
fernape marked 2 inline comments as done.