Commit 9cf1a8fa authored by Alexander Potashev's avatar Alexander Potashev Committed by Dmitry Kazakov

Update Messages.sh to extract messages from kundo2_i18n*() calls

When extracting from kundo2_i18n*() calls, the scripts Messages.sh
also prepend "(qtundo-format)" to context strings (msgctxt) in the
resulting translation template (.pot).
parent 9e143a4e
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp *.h -o $podir/kdgantt.pot
source ../../calligra_xgettext.sh
XGETTEXT=${XGETTEXT_QT} calligra_xgettext *.cpp *.h > $podir/kdgantt.pot
#
# Helper function for extracting translatable messages from Calligra source code
# Usage example:
# calligra_xgettext planlibs.pot "`find . -name \*.cpp -o -name \*.h`"
#
function calligra_xgettext() {
SRC_FILES="$*"
POT_PART_NORMAL="`mktemp $podir/_normal_XXXXXXXX.pot`"
POT_PART_QUNDOFORMAT="`mktemp $podir/_qundoformat_XXXXXXXX.pot`"
POT_MERGED="`mktemp $podir/_merged_XXXXXXXX.pot`"
$XGETTEXT ${CXG_EXTRA_ARGS} ${SRC_FILES} -o "${POT_PART_NORMAL}"
$XGETTEXT_PROGRAM --from-code=UTF-8 -C --kde -kkundo2_i18n:1 -kkundo2_i18np:1,2 -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 ${CXG_EXTRA_ARGS} ${SRC_FILES} -o "${POT_PART_QUNDOFORMAT}"
if [ $(cat ${POT_PART_NORMAL} ${POT_PART_QUNDOFORMAT} | grep -c \(qtundo-format\)) != 0 ]; then
echo "ERROR: Context '(qtundo-format)' should not be added manually. Use kundo2_i18n*() calls instead." 1>&2
exit 17
fi
if [ -f "${POT_PART_QUNDOFORMAT}" ]; then
# Prepend "(qtundo-format)" to existing msgctxt properties of messages
sed -i -e 's/^msgctxt "/msgctxt "(qtundo-format) /' "${POT_PART_QUNDOFORMAT}"
# Add msgctxt "(qundo-format)" to messages not having msgctxt yet
sed -i -e '/^#/{n;/msgid "/i \msgctxt "(qtundo-format)"
}' "${POT_PART_QUNDOFORMAT}"
fi
if [[ -f "${POT_PART_NORMAL}" && -f "${POT_PART_QUNDOFORMAT}" ]]; then
${MSGCAT} -F "${POT_PART_NORMAL}" "${POT_PART_QUNDOFORMAT}" > ${POT_MERGED}
MERGED_HEADER_LINE_COUNT=$(cat ${POT_MERGED} | grep "^$" -B 100000 --max-count=1 | wc -l)
KDE_HEADER="$(cat ${POT_PART_NORMAL} | grep "^$" -B 100000 --max-count=1)"
MERGED_TAIL="$(cat ${POT_MERGED} | tail -n +$MERGED_HEADER_LINE_COUNT)"
# Print out the resulting .pot
echo "$KDE_HEADER"
echo "$MERGED_TAIL"
elif [ -f "${POT_PART_NORMAL}" ]; then
cat "${POT_PART_NORMAL}"
elif [ -f "${POT_PART_QUNDOFORMAT}" ]; then
cat "${POT_PART_QUNDOFORMAT}"
fi
rm -f "${POT_PART_NORMAL}" "${POT_PART_QUNDOFORMAT}" "${POT_MERGED}"
}
#! /bin/sh
source ../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui | grep -v '/tests/'` >> rc.cpp
RCFILES=`find . -name \*.rc \
| grep -v plugins/extensions/metadataeditor/editors/dublincore.rc \
......@@ -9,5 +11,5 @@ RCFILES=`find . -name \*.rc \
$EXTRACTRC $RCFILES >> rc.cpp
perl extracti18n.pl > i18ndata
# ignore sdk/templates since it contains templates for use a future plugins, none of the strings there will ever be seen by any user
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 i18ndata rc.cpp `find . -name \*.cc -o -name \*.h -o -name \*.cpp | grep -v '/tests/' | grep -v './sdk/templates'` ui/kis_aboutdata.h -o $podir/krita.pot
calligra_xgettext i18ndata rc.cpp `find . -name \*.cc -o -name \*.h -o -name \*.cpp | grep -v '/tests/' | grep -v './sdk/templates'` ui/kis_aboutdata.h > $podir/krita.pot
rm -f i18ndata
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/crashhandler.pot
source ../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/crashhandler.pot
#! /bin/sh
source ../calligra_xgettext.sh
EXCLUDE="-path ./koproperty -o -path ./koreports"
LIST=`find . \( \( $EXCLUDE \) -prune -o -name \*.ui -o -name \*.rc \) -type f | grep -v -e '/\.'`
$EXTRACTRC $LIST >> rc.cpp
LIST=`find . \( \( $EXCLUDE \) -prune -o -name \*.cpp -o -name \*.cc -o -name \*.h \) -type f | grep -v '/tests/' | grep -v -e '/\.'`
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 $LIST -o $podir/calligra.pot
calligra_xgettext $LIST > $podir/calligra.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp editors/*.cpp -o $podir/koproperty.pot
source $srcdir/../../calligra_xgettext.sh
calligra_xgettext *.cpp editors/*.cpp > $podir/koproperty.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp *.h -o $podir/ArtisticTextShape.pot
calligra_xgettext *.cpp *.h > $podir/ArtisticTextShape.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp` -o $podir/ChartShape.pot
calligra_xgettext `find . -name \*.cpp` > $podir/ChartShape.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp -o -name \*.h` -o $podir/kocolorspaces.pot
source ../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp -o -name \*.h` > $podir/kocolorspaces.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/CommentShape.pot
source ../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/CommentShape.pot
#! /bin/sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp */*.cpp -o $podir/calligra-defaulttools.pot
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
calligra_xgettext *.cpp */*.cpp > $podir/calligra-defaulttools.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 $(find . -name "*.cpp") -o $podir/calligra-dockers.pot
source ../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp` > $podir/calligra-dockers.pot
#! /bin/sh
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp *.h elements/*.cpp elements/*.h -o $podir/FormulaShape.pot
source ../../calligra_xgettext.sh
$EXTRACTRC *.ui >> rc.cpp
calligra_xgettext *.cpp *.h elements/*.cpp elements/*.h > $podir/FormulaShape.pot
rm -f rc.cpp
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC *.rc *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/keximigrate_spreadsheet.pot
calligra_xgettext `find . -name \*.cpp` > $podir/keximigrate_spreadsheet.pot
if [ ! -s $podir/keximigrate_spreadsheet.pot ]; then
rm -f $podir/keximigrate_spreadsheet.pot
fi
rm -f rc.cpp
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp -o -name \*.cc` -o $podir/MusicShape.pot
calligra_xgettext `find . -name \*.cpp -o -name \*.cc` > $podir/MusicShape.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp -o -name \*.cc` -o $podir/PathShapes.pot
calligra_xgettext `find . -name \*.cpp -o -name \*.cc` > $podir/PathShapes.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp` -o $podir/PictureShape.pot
calligra_xgettext `find . -name \*.cpp` > $podir/PictureShape.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/PluginShape.pot
source ../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/PluginShape.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/koreport_barcodeplugin.pot
source ../../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp` > $podir/koreport_barcodeplugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/koreport_chartplugin.pot
source ../../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp` > $podir/koreport_chartplugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/koreport_mapsplugin.pot
source ../../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp` > $podir/koreport_mapsplugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/koreport_webplugin.pot
source ../../../calligra_xgettext.sh
calligra_xgettext `find . -name \*.cpp` > $podir/koreport_webplugin.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/calligra_semanticitem_contact.pot
calligra_xgettext `find . -name \*.cpp` > $podir/calligra_semanticitem_contact.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/calligra_semanticitem_event.pot
calligra_xgettext `find . -name \*.cpp` > $podir/calligra_semanticitem_event.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/calligra_semanticitem_location.pot
calligra_xgettext `find . -name \*.cpp` > $podir/calligra_semanticitem_location.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC *.rc *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/googledocs_plugin.pot
calligra_xgettext *.cpp > $podir/googledocs_plugin.pot
rm -f rc.cpp
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC *.rc *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/sheetspivottables_plugin.pot
calligra_xgettext *.cpp > $podir/sheetspivottables_plugin.pot
rm -f rc.cpp
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/TemplateShape.pot
source ../../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/TemplateShape.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/ThreedShape.pot
source ../../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/ThreedShape.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/AutocorrectPlugin.pot
calligra_xgettext *.cpp > $podir/AutocorrectPlugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/ChangecasePlugin.pot
source ../../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/ChangecasePlugin.pot
#! /bin/sh
source ../../../calligra_xgettext.sh
$EXTRACTRC --tag=string *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/SpellCheckPlugin.pot
calligra_xgettext *.cpp > $podir/SpellCheckPlugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/thesaurus_tool.pot
source ../../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/thesaurus_tool.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp ` -o $podir/TextShape.pot
calligra_xgettext `find . -name \*.cpp` > $podir/TextShape.pot
rm -f rc.cpp
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp *.ui -o $podir/VariablesPlugin.pot
calligra_xgettext *.cpp *.ui > $podir/VariablesPlugin.pot
#! /bin/sh
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 *.cpp -o $podir/VectorShape.pot
source ../../calligra_xgettext.sh
calligra_xgettext *.cpp > $podir/VectorShape.pot
#! /bin/sh
source ../../calligra_xgettext.sh
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT -kkundo2_i18nc:1c,2 -kkundo2_i18ncp:1c,2,3 `find . -name \*.cpp` -o $podir/VideoShape.pot
calligra_xgettext `find . -name \*.cpp` > $podir/VideoShape.pot
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment