Page MenuHomeFreeBSD

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

Authored by fernape on Sep 8 2021, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 12, 1:50 AM
Unknown Object (File)
Thu, Mar 7, 3:59 PM
Unknown Object (File)
Feb 15 2024, 2:07 AM
Unknown Object (File)
Dec 20 2023, 7:58 AM
Unknown Object (File)
Dec 14 2023, 11:34 PM
Unknown Object (File)
Nov 12 2023, 2:04 PM
Unknown Object (File)
Nov 11 2023, 3:41 AM
Unknown Object (File)
Nov 10 2023, 2:13 PM
Subscribers
None

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

fernape created this revision.
dbaio requested changes to this revision.Sep 9 2021, 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.

27–31

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
37–42

In a few cases you mean?

43–52

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.Sep 9 2021, 12:12 AM
tools/translate.sh
27–31

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
37–42

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

43–52

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.Sep 9 2021, 8:27 PM
This revision was automatically updated to reflect the committed changes.
fernape marked 2 inline comments as done.