From 87257e00a5ff5f9a575c69029311876bf918fb89046c52d5b9a28524b48c9d81 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 18 Jan 2013 21:13:46 +0000 Subject: [PATCH] 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 --- HEADER.pot | 2 +- gnome-patch-translation-files.tar.bz2 | 4 +- gnome-patch-translation-prepare | 53 +++++++++++++++++-- gnome-patch-translation-update | 73 +++++++++++++++++++++------ gnome-patch-translation.changes | 6 +++ gnome-patch-translation.conf | 4 +- gnome-patch-translation.tar.bz2 | 4 +- 7 files changed, 118 insertions(+), 28 deletions(-) diff --git a/HEADER.pot b/HEADER.pot index 8103aab..ec4febc 100644 --- a/HEADER.pot +++ b/HEADER.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/gnome-patch-translation-files.tar.bz2 b/gnome-patch-translation-files.tar.bz2 index b3c7991..2b2ad98 100644 --- a/gnome-patch-translation-files.tar.bz2 +++ b/gnome-patch-translation-files.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:84bdacb18d6676813645a5eea8543c493af472bf7243f52ac7b0188df0626981 -size 94991 +oid sha256:ce29d35748b12cd12d7095d9c828097d7c2bddcf77f58bc53b112a7cf8908cb1 +size 101569 diff --git a/gnome-patch-translation-prepare b/gnome-patch-translation-prepare index 1f56923..685044f 100644 --- a/gnome-patch-translation-prepare +++ b/gnome-patch-translation-prepare @@ -1,8 +1,51 @@ #! /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 -intltool-update --pot -mkdir -p ../gnome-patch-translation/old -mv *.pot ../gnome-patch-translation/old +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. +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 diff --git a/gnome-patch-translation-update b/gnome-patch-translation-update index 0692cbb..9281257 100644 --- a/gnome-patch-translation-update +++ b/gnome-patch-translation-update @@ -1,22 +1,61 @@ #! /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 +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. -cd po -intltool-update --pot -mkdir ../gnome-patch-translation/new -cp -a *.pot ../gnome-patch-translation/new -cd ../gnome-patch-translation/new +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 + 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 if test $? -eq 0 -a ! -f $POT-unique.pot ; then echo "" 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 "" exit 1 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 -cd ../po +cd "$TOP_DIR/$DIR" # Main action. Only this is really needed for package rebuild. for PO in *.po ; do @@ -42,18 +81,20 @@ for PO in *.po ; do done # This action takes long time. Run it only if we really need it. 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 LNG=${PO%.po} echo "Creating fuzzy $PO for gnome-patch-translation." - msgmerge -o ../gnome-patch-translation/$POT-$LNG.po $PO ../gnome-patch-translation/$POT-patch.pot - sed -i 's@#: \.\./@#: '$POT'/@;/#~/,$d' ../gnome-patch-translation/$POT-$LNG.po + msgmerge -o $TOP_DIR/gnome-patch-translation$EXT/$POT-$LNG.po $PO $TOP_DIR/gnome-patch-translation$EXT/$POT-patch.pot + 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 echo "=================================================================" echo " Translatable strings from patches were written to" - echo " gnome-patch-translation/. If you did any translatable string" - echo " change in any patch, please follow HOWTO in" - echo " gnome-patch-translation package source." + echo " gnome-patch-translation$EXT/." + echo " If you did any translatable string change in any patch," + echo " please follow HOWTO in gnome-patch-translation package source." echo "=================================================================" else echo " Skipping compendium update. Use COMPENDIUM_UPDATE_MODE=1 to force it." diff --git a/gnome-patch-translation.changes b/gnome-patch-translation.changes index 7bf8284..e98f7c7 100644 --- a/gnome-patch-translation.changes +++ b/gnome-patch-translation.changes @@ -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 diff --git a/gnome-patch-translation.conf b/gnome-patch-translation.conf index 6d98d7b..9b04f4c 100644 --- a/gnome-patch-translation.conf +++ b/gnome-patch-translation.conf @@ -18,10 +18,10 @@ OSC_REPOSITORIES=( GNOME:Factory openSUSE:Factory ) # list of packages in gnome-patch-translation project # 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. -GPT_VERSION="12.2" +GPT_VERSION="12.3" # osc server, empty for using of the osc default OSC_APIURL= diff --git a/gnome-patch-translation.tar.bz2 b/gnome-patch-translation.tar.bz2 index 482627f..3ccf40e 100644 --- a/gnome-patch-translation.tar.bz2 +++ b/gnome-patch-translation.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29b88989884b4fa3b50f32b564d6671457628413be644cf5c4885564ded66b51 -size 365051 +oid sha256:42c3f85dad6fc98cf38c586eb5b6374c76284b048894caa664d631f607ae4ccc +size 365037