« Auto-éditer un wikilivre/Annexer (Version internationalisée)/cp all to Add appendix.bash » : différence entre les versions

Contenu supprimé Contenu ajouté
Mise à jour des corrections
Mise à jour des correction
Ligne 1 :
Ce script commande la mise à jour, ou l'installation, de tous les fichiers éprovéséprouvés dans le répertoire des tests de l'appli cationapplication Add_appendix
<syntaxhighlight lang="bash">
#!/bin/bash
Ligne 5 :
#H File : cp_all_to_Add_appendix.bash
#H Syntax : in tests directory ./cp_all_to_Add_appendix.bash
. gettext.sh
VERSION=210822210828
 
if pwd | grep Add_appendix; then
Ligne 45 ⟶ 46 :
cat $Testdir/2-annex.sh/$File2.sh > $Rootdir/src/$File2.sh
chmod 666 $Rootdir/src/$File2.sh
cat $Testdir/2-annex.sh/$File2.sh | grep -v "#T\|#O\|#P" > $Rootdir/bin/orig/$File2.orig
cat $Rootdir/bin/orig/$File2.orig | sed "s/eval_gettext /echo \$/g" | sed "s/; echo//g" \
| sed "s/\"\$(gettext '/\$\"/g" | sed "s/' )//g" | sed "s/')//g" > $Rootdir/bin/$File2
chmod 755 $Rootdir/bin/$File2
# création du fichier .pot
xgettext -L shell -o $Rootdir/share/locale/$File2.pot --from-code=UTF-8 $Rootdir/bin/$File2
# Création du fichier .po si il n'existe pas sinon mise à jour du fichier .po
if test -z $Rootdir/share/locale/fr/$File2.po
then
cp $Rootdir/share/locale/$File2.pot $Rootdir/share/locale/fr/$File2.po
poedit $Rootdir/share/locale/fr/$File2.po
else msgmerge --update $Rootdir/share/locale/fr/$File2.po $Rootdir/share/locale/$File2.pot
fi
# Création ou mise à jour du fichier .mo
msgfmt $Rootdir/share/locale/fr/$File2.po -o $Rootdir/share/locale/fr/LC_MESSAGES/$File2.mo
if test -e /usr/share/locale/fr/LC_MESSAGES/$File2.mo
then sudo cp $Rootdir/share/locale/fr/LC_MESSAGES/$File2.mo /usr/share/locale/fr/LC_MESSAGES/$File2.mo
fi
 
# $Testdir/3-header.inc.sh/
Ligne 53 ⟶ 70 :
cat $Testdir/3-$File3.sh/$File3.sh > $Rootdir/src/$File3.sh
chmod 666 $Rootdir/src/$File3.sh
cat $Testdir/3-$File3.sh/$File3.sh | grep -v "#T\|#O\|#P" > $Rootdir/bin/orig/$File3.orig
cat $Rootdir/bin/orig/$File3.orig | sed "s/eval_gettext /echo \$/g" | sed "s/; echo//g" \
| sed "s/\"\$(gettext '/\$\"/g" | sed "s/' )//g" | sed "s/')//g"> $Rootdir/bin/$File3
chmod 755 $Rootdir/bin/$File3
# création du fichier .pot
xgettext -L shell -o $Rootdir/share/locale/$File3.pot --from-code=UTF-8 $Rootdir/bin/$File3
# Création du fichier .po si il n'existe pas sinon mise à jour du fichier .po
if test -z $Rootdir/share/locale/fr/$File3.po
then
cp $Rootdir/share/locale/$File3.pot $Rootdir/share/locale/fr/$File3.po
poedit $Rootdir/share/locale/fr/$File3.po
else msgmerge --update $Rootdir/share/locale/fr/$File3.po $Rootdir/share/locale/$File3.pot
fi
# Création ou mise à jour du fichier .mo
msgfmt $Rootdir/share/locale/fr/$File3.po -o $Rootdir/share/locale/fr/LC_MESSAGES/$File3.mo
if test -e /usr/share/locale/fr/LC_MESSAGES/$File3.mo
then sudo cp $Rootdir/share/locale/fr/LC_MESSAGES/$File3.mo /usr/share/locale/fr/LC_MESSAGES/$File3.mo
fi
 
 
# $Testdir/4-list.sh/
Ligne 158 ⟶ 192 :
cat $Testdir/10-add_sclipwb.sh/fr_sclipwb.inc.sh | grep -v "#T\|#O\|#P" > $Rootdir/bin/fr_sclipwb.inc
chmod 666 $Rootdir/bin/fr_sclipwb.inc
 
</syntaxhighlight>
{{AutoCat}}