1
0

Accepting request 149153 from home:sbrabec:branches:GNOME:Factory

- Updated pl, ro.
- Allow to set translation domain.

OBS-URL: https://build.opensuse.org/request/show/149153
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-patch-translation?expand=0&rev=46
This commit is contained in:
Dominique Leuenberger 2013-01-18 21:13:46 +00:00 committed by Git OBS Bridge
parent 53a51f7af0
commit 87257e00a5
7 changed files with 118 additions and 28 deletions

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-01-07 22:00+0100\n" "POT-Creation-Date: 2013-01-18 21:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:84bdacb18d6676813645a5eea8543c493af472bf7243f52ac7b0188df0626981 oid sha256:ce29d35748b12cd12d7095d9c828097d7c2bddcf77f58bc53b112a7cf8908cb1
size 94991 size 101569

View File

@ -1,8 +1,51 @@
#! /bin/bash #! /bin/bash
set -o errexit if test "$1" = "--help" ; then
echo "Patch translation update tool works in top directory of unpacked source code."
echo "$0 is an utility that is called before applying of patches."
echo "Usage: $0 [translation_directory] [translation_domain] [command to create pot file]"
fi
cd po set -o errexit
intltool-update --pot shopt -s nullglob
mkdir -p ../gnome-patch-translation/old
mv *.pot ../gnome-patch-translation/old TOP_DIR=$PWD
DIR=${1:-po}
DOMAIN=$2
if test -d "$1" ; then
EXT=."$1"
else
EXT=
fi
cd "$DIR"
# This action takes some time. But run it every time to confirm, that update is still needed.
if test -z "$3" ; then
if test -z "$DOMAIN" ; then
intltool-update --pot
else
intltool-update --gettext-package=$DOMAIN --pot
fi
else
eval $3
fi
POT_NOT_UNIQUE=false
MISSING=true
for POT in *.pot ; do
if $POT_NOT_UNIQUE ; then
echo "ERROR: Directory $DIR contains more than one .pot file."
exit 1
fi
POT_NOT_UNIQUE=true
MISSING=false
mkdir -p "../gnome-patch-translation$EXT/old"
mv "$POT" "../gnome-patch-translation$EXT/old"
done
if $MISSING ; then
echo "ERROR: Directory $DIR does not contains any .pot file."
exit 1
fi

View File

@ -1,22 +1,61 @@
#! /bin/bash #! /bin/bash
if test "$1" = "--help" ; then
echo "Patch translation update tool works in top directory of unpacked source code."
echo "$0 is an utility that is called after applying of all patches."
echo "Usage: $0 [translation_directory] [translation_domain] [command to create pot file]"
fi
set -o errexit set -o errexit
shopt -s nullglob
TOP_DIR=$PWD
DIR=${1:-po}
DOMAIN=$2
if test -d "$1" ; then
EXT=."$1"
else
EXT=
fi
cd "$DIR"
# This action takes some time. But run it every time to confirm, that update is still needed. # This action takes some time. But run it every time to confirm, that update is still needed.
cd po if test -z "$3" ; then
intltool-update --pot if test -z "$DOMAIN" ; then
mkdir ../gnome-patch-translation/new intltool-update --pot
cp -a *.pot ../gnome-patch-translation/new else
cd ../gnome-patch-translation/new intltool-update --gettext-package=$DOMAIN --pot
fi
else
eval $3
fi
POT_NOT_UNIQUE=false
MISSING=true
for POT in *.pot ; do
if $POT_NOT_UNIQUE ; then
echo "ERROR: Directory $DIR contains more than one .pot file."
exit 1
fi
POT_NOT_UNIQUE=true
MISSING=false
POT=${POT%.pot}
done
if $MISSING ; then
echo "ERROR: Directory $DIR does not contains any .pot file."
exit 1
fi
mkdir $TOP_DIR/gnome-patch-translation$EXT/new
cp -a $POT.pot $TOP_DIR/gnome-patch-translation$EXT/new
cd $TOP_DIR/gnome-patch-translation$EXT
eval POT=$(echo *)
POT=${POT%.pot}
cd ..
msgcomm --unique -o $POT-unique.pot old/$POT.pot new/$POT.pot msgcomm --unique -o $POT-unique.pot old/$POT.pot new/$POT.pot
if test $? -eq 0 -a ! -f $POT-unique.pot ; then if test $? -eq 0 -a ! -f $POT-unique.pot ; then
echo "" echo ""
echo "No unique patch specific strings in project!" echo "No unique patch specific strings in project!"
echo "You can remove gnome-patch-translation support from this project." echo "You can remove gnome-patch-translation support from this directory."
echo "" echo ""
exit 1 exit 1
fi fi
@ -24,7 +63,7 @@ msgcomm --more-than=1 -o $POT-patch.pot $POT-unique.pot new/$POT.pot
rm -rf new old $POT-unique.pot rm -rf new old $POT-unique.pot
cd ../po cd "$TOP_DIR/$DIR"
# Main action. Only this is really needed for package rebuild. # Main action. Only this is really needed for package rebuild.
for PO in *.po ; do for PO in *.po ; do
@ -42,18 +81,20 @@ for PO in *.po ; do
done done
# This action takes long time. Run it only if we really need it. # This action takes long time. Run it only if we really need it.
if test "$COMPENDIUM_UPDATE_MODE" = 1 ; then if test "$COMPENDIUM_UPDATE_MODE" = 1 ; then
sed -i 's@#: \.\./@#: '$POT'/@' ../gnome-patch-translation/$POT-patch.pot sed -i '/^#:/s@ \.\./@ '$POT'/@' $TOP_DIR/gnome-patch-translation$EXT/$POT-patch.pot
for PO in *.po ; do for PO in *.po ; do
LNG=${PO%.po} LNG=${PO%.po}
echo "Creating fuzzy $PO for gnome-patch-translation." echo "Creating fuzzy $PO for gnome-patch-translation."
msgmerge -o ../gnome-patch-translation/$POT-$LNG.po $PO ../gnome-patch-translation/$POT-patch.pot msgmerge -o $TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po $PO $TOP_DIR/gnome-patch-translation$EXT/$POT-patch.pot
sed -i 's@#: \.\./@#: '$POT'/@;/#~/,$d' ../gnome-patch-translation/$POT-$LNG.po sed '/^#:/s@ \.\./@ '$POT'/@' <$TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po >$TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po.new
msgattrib --no-obsolete --force-po $TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po.new -o $TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po
rm $TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po.new
done done
echo "=================================================================" echo "================================================================="
echo " Translatable strings from patches were written to" echo " Translatable strings from patches were written to"
echo " gnome-patch-translation/. If you did any translatable string" echo " gnome-patch-translation$EXT/."
echo " change in any patch, please follow HOWTO in" echo " If you did any translatable string change in any patch,"
echo " gnome-patch-translation package source." echo " please follow HOWTO in gnome-patch-translation package source."
echo "=================================================================" echo "================================================================="
else else
echo " Skipping compendium update. Use COMPENDIUM_UPDATE_MODE=1 to force it." echo " Skipping compendium update. Use COMPENDIUM_UPDATE_MODE=1 to force it."

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 18 20:55:15 CET 2013 - sbrabec@suse.cz
- Updated pl, ro.
- Allow to set translation domain.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 7 20:52:57 CET 2013 - sbrabec@suse.cz Mon Jan 7 20:52:57 CET 2013 - sbrabec@suse.cz

View File

@ -18,10 +18,10 @@ OSC_REPOSITORIES=( GNOME:Factory openSUSE:Factory )
# list of packages in gnome-patch-translation project # list of packages in gnome-patch-translation project
# can re-appear after rebase of patches: gnome-power-manager gnome-session nautilus # can re-appear after rebase of patches: gnome-power-manager gnome-session nautilus
GPT_PACKAGES="gconf-editor gdm gnome-panel gnome-screensaver gnome-vfs2 gstreamer-0_10 gtk2 pan xchat" GPT_PACKAGES="gconf-editor gnome-panel gnome-screensaver gnome-vfs2 gstreamer-0_10 gtk2 pan xchat"
# Version of gnome-patch-translation-package. # Version of gnome-patch-translation-package.
GPT_VERSION="12.2" GPT_VERSION="12.3"
# osc server, empty for using of the osc default # osc server, empty for using of the osc default
OSC_APIURL= OSC_APIURL=

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:29b88989884b4fa3b50f32b564d6671457628413be644cf5c4885564ded66b51 oid sha256:42c3f85dad6fc98cf38c586eb5b6374c76284b048894caa664d631f607ae4ccc
size 365051 size 365037