[rkward-cvs] [rkward] /: Adjust Messages.standalone.sh to be able to test message extraction.

Albert Astals Cid aacid at kde.org
Sun Nov 23 20:52:52 UTC 2014


Why do you create that script instead of using the script that does it 
already?

http://tsdgeos.blogspot.com/2010/08/how-to-run-messagessh-file-to-create.html

Cheers,
  Albert

El Diumenge, 23 de novembre de 2014, a les 18:07:15, Thomas Friedrichsmeier va 
escriure:
> Git commit 791f8e6dd969930307a72c8cb9cb362ce5cb15af by Thomas
> Friedrichsmeier. Committed on 23/11/2014 at 18:04.
> Pushed by tfry into branch 'master'.
> 
> Adjust Messages.standalone.sh to be able to test message extraction.
> Adjust Messages.sh to not pick up files e.g. from a "build" directory.
> 
> M  +2    -0    .gitignore
> M  +2    -2    Messages.sh
> M  +10   -60   i18n/Messages.standalone.sh
> 
> http://commits.kde.org/rkward/791f8e6dd969930307a72c8cb9cb362ce5cb15af
> 
> diff --git a/.gitignore b/.gitignore
> index 1c782ea..da07d4b 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -6,3 +6,5 @@ rkward/resource.ver
>  rkward/version.h
>  # Log files from testing
>  tests/make_plugintests.txt
> +# Message templates should not be in the repo
> +*.pot
> diff --git a/Messages.sh b/Messages.sh
> index 21afa97..58c10ae 100755
> --- a/Messages.sh
> +++ b/Messages.sh
> @@ -2,9 +2,9 @@
> 
>  # invoke the extractrc script on all .ui, .rc, and .kcfg files in the
> sources # the results are stored in a pseudo .cpp file to be picked up by
> xgettext. -$EXTRACTRC `find . -name \*.rc -a \! -name
> rkward_windows_icon.rc -o -name \*.ui -o -name \*.kcfg`  >> rc.cpp
> +$EXTRACTRC `find rkward -name \*.rc -a \! -name rkward_windows_icon.rc -o
> -name \*.ui -o -name \*.kcfg`  >> rc.cpp #
>  # call xgettext on all source files. If your sources have other filename
>  # extensions besides .cc, .cpp, and .h, just add them in the find call.
> -$XGETTEXT `find . -name \*.cpp -o -name \*.h -name \*.c` -o
> $podir/rkward.pot +$XGETTEXT `find rkward -name \*.cpp -o -name \*.h -name
> \*.c` -o $podir/rkward.pot
> 
> diff --git a/i18n/Messages.standalone.sh b/i18n/Messages.standalone.sh
> index 8daa05a..d719820 100755
> --- a/i18n/Messages.standalone.sh
> +++ b/i18n/Messages.standalone.sh
> @@ -1,67 +1,17 @@
>  #!/bin/sh
> -BASEDIR="../rkward/"	# root of translatable sources
> -PROJECT="rkward"	# project name
> -BUGADDR="http://p.sf.net/rkward/bugs"	# MSGID-Bugs
> -WDIR=`pwd`		# working dir
> -
> -check_error()
> -{
> -	if [ "$?" -ne "0" ]; then
> -		echo "ERROR: ${1}"
> -		exit 1
> -	fi
> -}
> -
> -echo "Preparing rc files"
> -cd ${BASEDIR}
> -# we use simple sorting to make sure the lines don't jump around too much
> from system to system -find . -name '*.rc' -o -name '*.ui' -o -name
> '*.kcfg' | sort > ${WDIR}/rcfiles.list -xargs
> --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
> -check_error "Failed to extract messages from rc files. Do you have
> extractrc installed?" -# additional string for KAboutData
> -echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
> -echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
> -cd ${WDIR}
> -echo "Done preparing rc files"
> -
> -
> -echo "Extracting messages"
> -cd ${BASEDIR}
> -# see above on sorting
> -find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort >
> ${WDIR}/infiles.list -echo "rc.cpp" >> ${WDIR}/infiles.list
> -cd ${WDIR}
> -xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2
> -ki18ncp:1c,2,3 -ktr2i18n:1 \ -	-kI18N_NOOP:1 -kI18N_NOOP2:1c,2
> -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
> -	--msgid-bugs-address="${BUGADDR}" \
> -	--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot
> -check_error "Failed to extract messages from source files. Do you have
> xgettext installed?" -echo "Done extracting messages"
> -
> -
> -# Note: .po-file are now maintained (and merged) on launchpad
> -#
> -# echo "Merging translations"
> -# catalogs=`find . -name '*.po'`
> -# for cat in $catalogs; do
> -#   echo $cat
> -#   msgmerge -o $cat.new $cat ${PROJECT}.pot
> -#   check_error "Failed to merge messages. Do you have msgmerge installed?"
> -#   mv $cat.new $cat
> -# done
> -# echo "Done merging translations"
> -
> -
> -echo "Cleaning up"
> -cd ${WDIR}
> -rm rcfiles.list
> -rm infiles.list
> +BASEDIR=`dirname $0`/../rkward/ # root of translatable sources
> +export EXTRACTRC=`which extractrc`
> +export XGETTEXT="xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1
> -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \ +                   
>       -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2
> -kki18np:1,2 -kki18ncp:1c,2,3" +export podir=`dirname $0`
> +
> +cd ${BASEDIR}/..
> +/bin/sh Messages.sh
>  rm rc.cpp
> -echo "Done"
> 
>  echo "Extracting messages from plugins"
>  cd ${BASEDIR}
>  # For testing purposes, extract analysis.pluginmap, only
> -python ../scripts/extract_plugin_messages.py --outdir=../po/plugins/
> plugins/analysis.pluginmap -python ../scripts/extract_plugin_messages.py
> --outdir=../po/plugins/ --default_po=testing
> plugins/under_development.pluginmap +python
> ../scripts/extract_plugin_messages.py --outdir=../i18n/
> plugins/analysis.pluginmap +#python ../scripts/extract_plugin_messages.py
> --outdir=../po/plugins/ --default_po=testing
> plugins/under_development.pluginmap echo "Done"





More information about the rkward-tracker mailing list