From nobody Sun Nov 21 12:27:59 2021 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 788C7189D0E1 for ; Sun, 21 Nov 2021 12:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HxqRz2zjtz3MwS; Sun, 21 Nov 2021 12:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 467BE7612; Sun, 21 Nov 2021 12:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALCRx3r003763; Sun, 21 Nov 2021 12:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALCRxMA003762; Sun, 21 Nov 2021 12:27:59 GMT (envelope-from git) Date: Sun, 21 Nov 2021 12:27:59 GMT Message-Id: <202111211227.1ALCRxMA003762@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: "Danilo G. Baio" Subject: git: cd71c465b9 - main - tools/translate.sh: Improve usage List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dbaio X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd71c465b97d7563bedda9cb265afc91a84c80de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dbaio: URL: https://cgit.FreeBSD.org/doc/commit/?id=cd71c465b97d7563bedda9cb265afc91a84c80de commit cd71c465b97d7563bedda9cb265afc91a84c80de Author: Danilo G. Baio AuthorDate: 2021-11-20 14:06:22 +0000 Commit: Danilo G. Baio CommitDate: 2021-11-21 12:24:20 +0000 tools/translate.sh: Improve usage - Update .po file with the source document before translating. - Allow translation of a specific document. Translate all es documents: ./tools/translate.sh documentation es Translate only pt-br articles/bsdl-gpl: ./tools/translate.sh documentation pt-br articles/bsdl-gpl Reviewed by: fernape Differential Revision: https://reviews.freebsd.org/D33067 --- tools/translate.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/translate.sh b/tools/translate.sh index c5a4ab895e..10be78aa05 100755 --- a/tools/translate.sh +++ b/tools/translate.sh @@ -54,13 +54,16 @@ fixup_includes() } if [ "$1" = "" ] || [ "$2" = "" ]; then - echo "Need to inform which component and|or language." - echo "$0 documentation|website pt_BR|es" + echo "Need to inform component and language:" + echo " $0 documentation es" + echo "A third (optional) argument can be informed to translate only a specific document:" + echo " $0 documentation pt-br articles/bsdl-gpl" exit 1 fi COMPONENT="$1" LANGUAGE="$2" +SEARCH_RESTRICT="$3" # po4a-translate option: -k, --keep # Minimal threshold for translation percentage to keep (i.e. write) @@ -79,7 +82,7 @@ if [ ! -d "$COMPONENT/content/$LANGUAGE" ]; then exit 1 fi -for pofile in $(find "$COMPONENT/content/$LANGUAGE/" -name "*.po" ); do +for pofile in $(find "$COMPONENT/content/$LANGUAGE/$SEARCH_RESTRICT" -name "*.po"); do name=$(basename -s .po "$pofile") if [ "$name" = "chapters-order" ]; then continue @@ -92,6 +95,19 @@ for pofile in $(find "$COMPONENT/content/$LANGUAGE/" -name "*.po" ); do echo "....." echo "$pofile" + po4a-updatepo \ + --format asciidoc \ + --option compat=asciidoctor \ + --option yfm_keys=title,part,description \ + --master "$adoc_orig" \ + --master-charset "UTF-8" \ + --copyright-holder "The FreeBSD Project" \ + --package-name "FreeBSD Documentation" \ + --po "$pofile" + if [ -f "${pofile}~" ]; then + rm -f "${pofile}~" + fi + po4a-translate \ --format asciidoc \ --option compat=asciidoctor \