From dde75a325a43b01cbdce4c1fae7c2364a3f5383f Mon Sep 17 00:00:00 2001 From: Jibec Date: Aug 21 2017 15:31:48 +0000 Subject: [PATCH 1/3] Add a po4a.cfg for automatic pot, po and localized asciidoc files --- diff --git a/_l10n/make_pot.sh b/_l10n/make_pot.sh deleted file mode 100755 index f679bd4..0000000 --- a/_l10n/make_pot.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -dir="../en-US" # no trailing slash - -for file in $( find -L $dir -name "*.adoc" ); do - basename=`basename -s .adoc $file` - dirname=`dirname $file` - path=`echo ${dirname#$dir/}` - if [ "$dirname" = "$dir" ]; then - potname=$basename.po - else - potname=$path/$basename.pot - mkdir -p pot/$path - fi - echo po4a-gettextize -f asciidoc -m $file -p pot/$potname --master-charset "UTF-8" - po4a-gettextize -f asciidoc -m $file -p pot/$potname --master-charset "UTF-8" -o debug split_attributelist -done - diff --git a/_l10n/make_trans.sh b/_l10n/make_trans.sh new file mode 100755 index 0000000..df110f2 --- /dev/null +++ b/_l10n/make_trans.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Author: Jean-Baptiste Holcroft // jibecfed +# This file produce a po4a config file and run po4a +# po4a update all pot, po and publish content + +dir="../en-US" # no trailing slash +PO4ACONF=./po4a.cfg + +cat >$PO4ACONF <<'EOT' +[po4a_langs] fr +[po4a_paths] pot/$master.pot $lang:pot/$master.$lang.po +[options] opt:"-k 0" + +EOT + +for file in $( find -L $dir -name "*.adoc" ); do + basename=`basename -s .adoc $file` + dirname=`dirname $file` + path=`echo ${dirname#$dir/}` + if [ "$dirname" = "$dir" ]; then + potname="$basename.adoc" + else + potname="$path/$basename.adoc" + fi + # update list of file to translate + echo "[type: text] $file \$lang:../\$lang/$potname" + echo "[type: text] $file \$lang:../\$lang/$potname" >> $PO4ACONF +done + +# generate po files and generate translated content +po4a $PO4ACONF \ + --package-name "Fedora.Next-Documentation" \ + --package-version `date +%Y%m%d`\ + --msgid-bugs-address docs@lists.fedoraproject.org \ + --master-charset utf8 diff --git a/_l10n/po4a.cfg b/_l10n/po4a.cfg new file mode 100644 index 0000000..280ca46 --- /dev/null +++ b/_l10n/po4a.cfg @@ -0,0 +1,52 @@ +[po4a_langs] fr +[po4a_paths] pot/$master.pot $lang:pot/$master.$lang.po +[options] opt:"-k 0" + +[type: text] ../en-US/entities.adoc $lang:../$lang/entities.adoc +[type: text] ../en-US/Author_Group.adoc $lang:../$lang/Author_Group.adoc +[type: text] ../en-US/Preface.adoc $lang:../$lang/Preface.adoc +[type: text] ../en-US/install/CustomSpoke_AddBtrfs.adoc $lang:../$lang/install/CustomSpoke_AddBtrfs.adoc +[type: text] ../en-US/install/After_Installation.adoc $lang:../$lang/install/After_Installation.adoc +[type: text] ../en-US/install/NetworkSpoke.adoc $lang:../$lang/install/NetworkSpoke.adoc +[type: text] ../en-US/install/NetworkSpoke_VirtualInterfaces.adoc $lang:../$lang/install/NetworkSpoke_VirtualInterfaces.adoc +[type: text] ../en-US/install/StorageSpoke_BootLoader.adoc $lang:../$lang/install/StorageSpoke_BootLoader.adoc +[type: text] ../en-US/install/FilterSpoke_AddFCoE.adoc $lang:../$lang/install/FilterSpoke_AddFCoE.adoc +[type: text] ../en-US/install/CustomSpoke_AddLVM.adoc $lang:../$lang/install/CustomSpoke_AddLVM.adoc +[type: text] ../en-US/install/Installing_Using_Anaconda.adoc $lang:../$lang/install/Installing_Using_Anaconda.adoc +[type: text] ../en-US/install/DateTimeSpoke.adoc $lang:../$lang/install/DateTimeSpoke.adoc +[type: text] ../en-US/install/KdumpSpoke.adoc $lang:../$lang/install/KdumpSpoke.adoc +[type: text] ../en-US/install/NetworkSpoke_EditConnection.adoc $lang:../$lang/install/NetworkSpoke_EditConnection.adoc +[type: text] ../en-US/install/Preparing_for_Installation.adoc $lang:../$lang/install/Preparing_for_Installation.adoc +[type: text] ../en-US/install/PasswordSpoke.adoc $lang:../$lang/install/PasswordSpoke.adoc +[type: text] ../en-US/install/SourceSpoke.adoc $lang:../$lang/install/SourceSpoke.adoc +[type: text] ../en-US/install/CustomSpoke_PartitioningAdvice.adoc $lang:../$lang/install/CustomSpoke_PartitioningAdvice.adoc +[type: text] ../en-US/install/SoftwareSpoke.adoc $lang:../$lang/install/SoftwareSpoke.adoc +[type: text] ../en-US/install/LangSupportSpoke.adoc $lang:../$lang/install/LangSupportSpoke.adoc +[type: text] ../en-US/install/CustomSpoke.adoc $lang:../$lang/install/CustomSpoke.adoc +[type: text] ../en-US/install/WelcomeSpoke.adoc $lang:../$lang/install/WelcomeSpoke.adoc +[type: text] ../en-US/install/FilterSpoke.adoc $lang:../$lang/install/FilterSpoke.adoc +[type: text] ../en-US/install/FilterSpoke_AddiSCSI.adoc $lang:../$lang/install/FilterSpoke_AddiSCSI.adoc +[type: text] ../en-US/install/Booting_the_Installation.adoc $lang:../$lang/install/Booting_the_Installation.adoc +[type: text] ../en-US/install/Troubleshooting.adoc $lang:../$lang/install/Troubleshooting.adoc +[type: text] ../en-US/install/KeyboardSpoke.adoc $lang:../$lang/install/KeyboardSpoke.adoc +[type: text] ../en-US/install/CustomSpoke_AddPhysical.adoc $lang:../$lang/install/CustomSpoke_AddPhysical.adoc +[type: text] ../en-US/install/InitialSetupHub.adoc $lang:../$lang/install/InitialSetupHub.adoc +[type: text] ../en-US/install/StorageSpoke.adoc $lang:../$lang/install/StorageSpoke.adoc +[type: text] ../en-US/install/CustomSpoke_RecommendedScheme.adoc $lang:../$lang/install/CustomSpoke_RecommendedScheme.adoc +[type: text] ../en-US/install/UserSpoke.adoc $lang:../$lang/install/UserSpoke.adoc +[type: text] ../en-US/install/CustomSpoke_FileSystems.adoc $lang:../$lang/install/CustomSpoke_FileSystems.adoc +[type: text] ../en-US/install/ProgressHub.adoc $lang:../$lang/install/ProgressHub.adoc +[type: text] ../en-US/install/SummaryHub.adoc $lang:../$lang/install/SummaryHub.adoc +[type: text] ../en-US/install/CustomSpoke_SoftwareRAID.adoc $lang:../$lang/install/CustomSpoke_SoftwareRAID.adoc +[type: text] ../en-US/Introduction.adoc $lang:../$lang/Introduction.adoc +[type: text] ../en-US/Book_Info.adoc $lang:../$lang/Book_Info.adoc +[type: text] ../en-US/Downloading_Fedora.adoc $lang:../$lang/Downloading_Fedora.adoc +[type: text] ../en-US/Revision_History.adoc $lang:../$lang/Revision_History.adoc +[type: text] ../en-US/advanced/Kickstart_Installations.adoc $lang:../$lang/advanced/Kickstart_Installations.adoc +[type: text] ../en-US/advanced/Upgrading_Your_Current_System.adoc $lang:../$lang/advanced/Upgrading_Your_Current_System.adoc +[type: text] ../en-US/advanced/Network_based_Installations.adoc $lang:../$lang/advanced/Network_based_Installations.adoc +[type: text] ../en-US/advanced/VNC_Installations.adoc $lang:../$lang/advanced/VNC_Installations.adoc +[type: text] ../en-US/advanced/Boot_Options.adoc $lang:../$lang/advanced/Boot_Options.adoc +[type: text] ../en-US/appendixes/Disk_Partitions.adoc $lang:../$lang/appendixes/Disk_Partitions.adoc +[type: text] ../en-US/appendixes/Understanding_LVM.adoc $lang:../$lang/appendixes/Understanding_LVM.adoc +[type: text] ../en-US/appendixes/Kickstart_Syntax_Reference.adoc $lang:../$lang/appendixes/Kickstart_Syntax_Reference.adoc From 8921332b5dfc6e20dd97fa5d5a1a38173fea941f Mon Sep 17 00:00:00 2001 From: Jibec Date: Aug 21 2017 15:31:48 +0000 Subject: [PATCH 2/3] Changed the way po file are stored so it is compatible with Zanata --- diff --git a/_l10n/make_trans.sh b/_l10n/make_trans.sh index df110f2..69110eb 100755 --- a/_l10n/make_trans.sh +++ b/_l10n/make_trans.sh @@ -8,7 +8,7 @@ PO4ACONF=./po4a.cfg cat >$PO4ACONF <<'EOT' [po4a_langs] fr -[po4a_paths] pot/$master.pot $lang:pot/$master.$lang.po +[po4a_paths] pot/$master.pot $lang:$lang/$master.po [options] opt:"-k 0" EOT diff --git a/_l10n/po4a.cfg b/_l10n/po4a.cfg index 280ca46..d4efe51 100644 --- a/_l10n/po4a.cfg +++ b/_l10n/po4a.cfg @@ -1,5 +1,5 @@ [po4a_langs] fr -[po4a_paths] pot/$master.pot $lang:pot/$master.$lang.po +[po4a_paths] pot/$master.pot $lang:$lang/$master.po [options] opt:"-k 0" [type: text] ../en-US/entities.adoc $lang:../$lang/entities.adoc From 1a94c30216c66dba6d0d4d415caaf121bb347465 Mon Sep 17 00:00:00 2001 From: Jibec Date: Aug 21 2017 15:31:48 +0000 Subject: [PATCH 3/3] Add zanata.xml file --- diff --git a/_l10n/zanata.xml b/_l10n/zanata.xml new file mode 100644 index 0000000..9dfb893 --- /dev/null +++ b/_l10n/zanata.xml @@ -0,0 +1,15 @@ + + + https://fedora.zanata.org/ + install-guide-reboot + master + gettext + pot + ./pot/ + + {filename}.{locale}.po + + + fr + +