Index: trunk/l10n-kf5/scripts/extract-messages.sh =================================================================== --- trunk/l10n-kf5/scripts/extract-messages.sh (revision 1522574) +++ trunk/l10n-kf5/scripts/extract-messages.sh (revision 1522575) @@ -1,81 +1,83 @@ #! /bin/bash podir=${podir:-$PWD/po} enpodir=${enpodir:-$PWD/enpo} files=`find . -name Messages.sh` dirs=`for i in $files; do echo \`dirname $i\`; done | sort -u` tmpname="$PWD/messages.log" l10nscripts=`dirname $0` EXTRACTRC=${EXTRACTRC:-extractrc} EXTRACTATTR=${EXTRACTATTR:-extractattr} EXTRACT_GRANTLEE_TEMPLATE_STRINGS=${EXTRACT_GRANTLEE_TEMPLATE_STRINGS:-grantlee_strings_extractor.py} EXTRACT_TR_STRINGS=${EXTRACT_TR_STRINGS:-$(readlink -f $l10nscripts/extract-tr-strings)} MSGCAT=${MSGCAT:-msgcat} +PACKAGE=${PACKAGE:-PACKAGE} PREPARETIPS=${PREPARETIPS:-preparetips} REPACKPOT=${REPACKPOT:-$(readlink -f $l10nscripts/repack-pot.pl)} export EXTRACTRC EXTRACTATTR MSGCAT PREPARETIPS REPACKPOT EXTRACT_GRANTLEE_TEMPLATE_STRINGS EXTRACT_TR_STRINGS if [ "x$IGNORE" = "x" ]; then IGNORE="/tests/" else IGNORE="$IGNORE /tests/" fi for subdir in $dirs; do # skip Messages.sh files of KDevelop's app templates grep '{APPNAMELC}[^ ]*.pot' $subdir/Messages.sh 1>/dev/null && continue test -z "$VERBOSE" || echo "Making messages in $subdir" (cd $subdir if find . -name \*.c\* -o -name \*.h\* | fgrep -v "$IGNORE" | xargs fgrep -s -q KAboutData ; then echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> rc.cpp echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> rc.cpp fi XGETTEXT_FLAGS="\ --copyright-holder=This_file_is_part_of_KDE \ +--package-name="${PACKAGE}" \ --msgid-bugs-address=http://bugs.kde.org \ --from-code=UTF-8 \ -C --kde \ -ci18n \ -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 \ -ki18nd:2 -ki18ndc:2c,3 -ki18ndp:2,3 -ki18ndcp:2c,3,4 \ -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ -kki18nd:2 -kki18ndc:2c,3 -kki18ndp:2,3 -kki18ndcp:2c,3,4 \ -kxi18n:1 -kxi18nc:1c,2 -kxi18np:1,2 -kxi18ncp:1c,2,3 \ -kxi18nd:2 -kxi18ndc:2c,3 -kxi18ndp:2,3 -kxi18ndcp:2c,3,4 \ -kkxi18n:1 -kkxi18nc:1c,2 -kkxi18np:1,2 -kkxi18ncp:1c,2,3 \ -kkxi18nd:2 -kkxi18ndc:2c,3 -kkxi18ndp:2,3 -kkxi18ndcp:2c,3,4 \ -kI18N_NOOP:1 -kI18NC_NOOP:1c,2 \ -kI18N_NOOP2:1c,2 -kI18N_NOOP2_NOSTRIP:1c,2 \ -ktr2i18n:1 -ktr2xi18n:1 \ " XGETTEXT_FLAGS_WWW="\ --copyright-holder=This_file_is_part_of_KDE \ --msgid-bugs-address=http://bugs.kde.org \ --from-code=UTF-8 \ -L PHP \ -ki18n -ki18n_var -ki18n_noop \ " export XGETTEXT_FLAGS export XGETTEXT_FLAGS_WWW if test -f Messages.sh; then # Note: Messages.sh is supposed to get the translators' placeholder by rc.cpp enpodir=$enpodir podir=$podir srcdir=. XGETTEXT_PROGRAM="${XGETTEXT:-xgettext}" XGETTEXT_WWW="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS_WWW" XGETTEXT="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS" bash Messages.sh fi exit_code=$? if test "$exit_code" -ne 0; then echo "Bash exit code: $exit_code" fi if [ "x$KEEPRCCPP" = "x" ]; then rm -f rc.cpp fi ) >& $tmpname test -s $tmpname && { echo $subdir ; cat "$tmpname"; } done # Repack extracted templates. find -L $podir -iname '*.pot' | xargs -r -n1 $REPACKPOT rm -f $tmpname Index: trunk/l10n-kf5/scripts/get_paths =================================================================== --- trunk/l10n-kf5/scripts/get_paths (revision 1522574) +++ trunk/l10n-kf5/scripts/get_paths (revision 1522575) @@ -1,323 +1,355 @@ still_in_svn="" all_modules="kde-kdeaccessibility \ kde-kdeadmin \ kde-applications \ kde-kde-runtime \ kde-kde-workspace \ kde-kdeedu \ kde-kdegames \ kde-kdegraphics \ kde-kdelibs \ kde-kdemultimedia \ kde-kdenetwork \ kde-kdepim-runtime \ kde-kdeplasma-addons \ kde-kdesdk \ kde-kdetoys \ kde-kdeutils \ kde-kdewebdev \ kde-pim \ kde-workspace \ extragear-accessibility \ extragear-artwork \ extragear-base \ extragear-edu \ extragear-games \ extragear-graphics \ extragear-kdevelop \ extragear-libs \ extragear-multimedia \ extragear-network \ extragear-office \ extragear-pim \ extragear-security \ extragear-sdk \ extragear-sysadmin \ extragear-utils \ kdesupport-phonon \ kdereview \ playground-accessibility \ playground-artwork \ playground-base \ playground-devtools \ playground-edu \ playground-games \ playground-graphics \ playground-ioslaves \ playground-libs \ playground-multimedia \ playground-network \ playground-mobile \ playground-office \ playground-pim \ playground-sdk \ playground-sysadmin \ playground-utils \ calligra \ websites \ frameworks" function list_modules { if [ "x$1" = "x" ]; then dir=. else dir=$1 fi rm -f $dir/kde_projects.xml wget -q http://projects.kde.org/kde_projects.xml -O $dir/kde_projects.xml if [ $? = "0" ]; then modules=$still_in_svn for gitmodule in $all_modules; do firstpart=`echo $gitmodule | sed -r -e 's/-.*$//'` secondpart=`echo $gitmodule | sed -r -e 's/^[^-]*-?//'` m=`python $dir/print_l10n_project_names.py $dir/kde_projects.xml $dir $firstpart $secondpart` modules="$modules $m" done echo $modules | tr " " "\n" | sort | tr "\n" " " rm -f $dir/kde_projects.xml else echo "" fi } function get_path { case "$1" in l10n) echo trunk/l10n-kf5 ;; kdesdk_kde-dev-scripts) echo git-unstable/$1 ;; kdelibs*|workspace_*|applications_*|frameworks_*|kdeaccessibility_*|kdeadmin_*|kdegames_*|kdegraphics_*|kdeedu_*|kdemultimedia_*|kdenetwork_*|kdepim-runtime|kdeplasma-addons|kdesdk_*|kdetoys_*|kdeutils_*|kdewebdev_*|pim_*) echo git-unstable-kf5/$1 ;; calligra*) echo git-unstable-kf5/$1 ;; extragear-*_*) echo git-unstable-kf5/extragear-`echo $1 | sed -e "s,extragear-,,"` ;; playground-*_*) echo git-unstable-kf5/playground-`echo $1 | sed -e "s,playground-,,"` ;; kdereview_*) echo git-unstable-kf5/`echo $1` ;; *) echo "ERROR: unknown module $1" # exit 1 ;; esac } function get_po_path { case "$1" in extragear-*_*) echo $1 | sed -r -e 's/_[^_]+$//' ;; playground-*_*) echo $1 | sed -r -e 's/_[^_]+$//' ;; www-*|websites_*) echo www ;; kdelibs_*|applications_*|kdegraphics_*|kdeedu_*|kdeutils_*|kdeaccessibility_*|kdemultimedia_*|kdegames_*|kdesdk_*|kdetoys_*|kdeadmin_*|kdenetwork_*|kdewebdev_*|frameworks_*|pim_*|calligra_*) echo $1 | sed -r -e 's/_[^_]+$//' ;; workspace_*) echo 'kde-workspace' ;; oxygen-icons) echo qt ;; kdereview_*) echo $1 | sed -r -e 's/_[^_]+$//' ;; kdesupport-phonon_*) echo qt ;; kdesupport_*) echo $1 | sed -r -e 's/_[^_]+$//' ;; *) echo $1 ;; esac } function get_vcs { case "$1" in qt) echo git ;; extragear-*_*) echo git ;; playground-*_*) echo git ;; kde-runtime|workspace_*|applications_*) echo git ;; kdegraphics_*|kdeedu_*|kdeutils_*|kdeaccessibility_*|kdemultimedia_*|kdegames_*|kdesdk_*|kdetoys_*|kdeadmin_*|kdenetwork_*|frameworks_*|pim_*|kdewebdev_*) echo git ;; kdereview_*) echo git ;; kdesupport-phonon_*) echo git ;; kdelibs*|kdeplasma-addons|kdepim-runtime) echo git ;; calligra*|websites_*) echo git ;; *) echo svn ;; esac } function get_branch { case "$1" in extragear-base_kwebkitpart) echo "master" ;; extragear-kdevelop_kdev-www|extragear-kdevelop_kdevplatform) echo "get_branch_none" ;; extragear-graphics_symboleditor|extragear-graphics_kxstitch|extragear-graphics_skanlite|extragear-graphics_kgraphviewer|extragear-graphics_kolor-manager|extragear-graphics_kphotoalbum) echo "master" ;; extragear-base_atcore|extragear-base_latte-dock|extragear-libs_kuserfeedback|extragear-network_kdeconnect-kde|extragear-network_kdeconnect-android|extragear-base_plasma-mobile|extragear-base_plasma-settings|extragear-base_wacomtablet|extragear-base_qtcurve) echo "master" ;; extragear-libs_kdb|extragear-libs_kproperty|extragear-libs_kreport) echo "master" ;; extragear-sdk_massif-visualizer|extragear-sdk_kdesvn) echo "master" ;; extragear-sysadmin_muon) echo "master" ;; applications_kde-baseapps|kdeedu_kdeedu-data|kdeedu_libkdeedu|kdeadmin_kuser) echo "get_branch_none" ;; kdepim-runtime|pim_*|frameworks_*|workspace_*|kdeplasma-addons|applications_*|kdegames_*|kdegraphics_gwenview|kdegraphics_kamera|kdegraphics_kcolorchooser|kdegraphics_kdegraphics-mobipocket|kdegraphics_kdegraphics-thumbnailers|kdegraphics_kolourpaint|kdegraphics_kruler|kdegraphics_okular|kdegraphics_spectacle|kdegraphics_svgpart|kdeedu_*|kdesdk_*|kdetoys_ktux|kdeutils_ark|kdeutils_kbackup|kdeutils_kcalc|kdeutils_kcharselect|kdeutils_kdebugsettings|kdeutils_kdf|kdeutils_kfloppy|kdeutils_kgpg|kdeutils_filelight|kdeutils_ktimer|kdeutils_print-manager|kdeutils_kteatime|kdeutils_kwalletmanager|kdeutils_sweeper|kdeadmin_*|kdenetwork_kio-extras|kdewebdev_kimagemapeditor) echo "master" ;; kdemultimedia_*) echo "master" ;; kdeaccessibility_kmag|kdeaccessibility_kmousetool|kdeaccessibility_kmouth) echo "master" ;; kdenetwork_kdenetwork-filesharing|kdenetwork_kget|kdenetwork_kopete|kdenetwork_ktp-accounts-kcm|kdenetwork_ktp-approver|kdenetwork_ktp-auth-handler|kdenetwork_ktp-call-ui|kdenetwork_ktp-common-internals|kdenetwork_ktp-contact-list|kdenetwork_ktp-contact-runner|kdenetwork_ktp-desktop-applets|kdenetwork_ktp-filetransfer-handler|kdenetwork_ktp-kded-module|kdenetwork_ktp-send-file|kdenetwork_ktp-text-ui|kdenetwork_kaccounts-integration|kdenetwork_kaccounts-providers|kdenetwork_signon-kwallet-extension|kdenetwork_krdc|kdenetwork_krfb|kdenetwork_zeroconf-ioslave) echo "master" ;; kdegraphics_libk*|extragear-libs_libkvkontakte|extragear-graphics_kipi-plugins|extragear-libs_libmediawiki) echo "master" ;; calligra|calligra_*) echo "master" ;; playground-libs_kasync|extragear-libs_libnm-qt|extragear-libs_libmm-qt|extragear-kdevelop_*|extragear-network_falkon|extragear-network_konversation|extragear-network_smb4k|extragear-sysadmin_apper|extragear-sysadmin_partitionmanager|extragear-sysadmin_kpmcore|extragear-sysadmin_libdebconf-kde|extragear-sysadmin_libqapt|extragear-graphics_digikam|extragear-graphics_kdiagram|extragear-graphics_digikam-doc|extragear-graphics_kipi-plugins-doc|extragear-graphics_krita|extragear-network_libringclient|extragear-network_choqok|extragear-network_libktorrent|extragear-network_ktorrent|extragear-network_kio-gdrive|extragear-network_kio-gopher|extragear-sdk_plasma-sdk|extragear-multimedia_amarok|extragear-multimedia_elisa|extragear-multimedia_kaffeine|extragear-multimedia_kaudiocreator|extragear-multimedia_kmplayer|extragear-multimedia_plasma-mediacenter|extragear-edu_gcompris|extragear-edu_kstars|extragear-edu_labplot|extragear-office_kbibtex|extragear-office_skrooge|extragear-office_kile|extragear-office_kmymoney|extragear-office_tellico|extragear-utils_kimtoy|extragear-utils_kio-stash|extragear-utils_kmarkdownwebview|extragear-utils_krename|extragear-utils_krusader|extragear-utils_kronometer|extragear-utils_okteta|extragear-utils_rsibreak|extragear-utils_isoimagewriter|extragear-utils_plasma-mycroft|extragear-utils_yakuake|extragear-sdk_heaptrack|extragear-games_knights|extragear-pim_ring-kde|extragear-pim_trojita|extragear-pim_zanshin) echo "master" ;; playground-base_kdepim-addons|playground-base_kubuntu-driver-kcm|playground-base_distro-release-notifier|playground-base_plasma-pk-updates|playground-base_plymouth-kcm|playground-base_kubuntu-debug-installer|playground-base_kubuntu-notification-helper|playground-base_whoopsie-kcm|playground-base_about-distro|playground-base_kwindowsaddons|playground-base_lancelot|playground-base_samba-mounter|playground-base_kde-new|playground-base_ktexteditorpreviewplugin|playground-pim_kpeoplevcard|playground-network_kpeople|playground-pim_akonadiclient|playground-pim_akonadi-phabricator-resource|playground-pim_ksmtp) echo "master" ;; playground-games_kmuddy|playground-graphics_colord-kde|playground-graphics_koko|playground-graphics_kooka|playground-graphics_kreenshot-editor|playground-graphics_kuickshow|playground-multimedia_audex|playground-artwork_smaragd|playground-multimedia_vvave) echo "master" ;; playground-devtools_ktechlab|playground-devtools_svgmod|playground-devtools_quanta|playground-devtools_kdev-control-flow-graph) echo "get_branch_none" ;; playground-devtools_*) echo "master" ;; playground-edu_rkward) echo "master" ;; playground-libs_purpose|playground-libs_qtjolie|playground-libs_solid-power|playground-libs_snorenotify) echo "master" ;; playground-mobile_*) echo "master" ;; playground-pim_kjots) echo "master" ;; playground-sdk_elf-dissector|playground-sdk_plasmate) echo "master" ;; playground-sysadmin_systemdgenie|playground-sysadmin_systemd-kcm|playground-sysadmin_kalternatives) echo "master" ;; playground-utils_kanalytics|playground-utils_kregexpeditor) echo "master" ;; extragear-libs_libkscreen) echo "frameworks" ;; kdereview_atlantik) echo "get_branch_none" ;; kdereview_*) echo "master" ;; *) echo "get_branch_none" ;; esac } +function get_repo_name +{ + case "$1" in + kdelibs|kdeplasma-addons|kdepim-runtime|calligra|qt|kde-runtime|kde-workspace) + echo "$1" + ;; + kdesupport-phonon_*) + repo=`echo $1 | sed -e "s/kdesupport-phonon_//"` + echo "$repo" + ;; + extragear-*_*) + repo=`echo $1 | sed -e "s/extragear-.*_//"` + echo "$repo" + ;; + playground-*_*) + repo=`echo $1 | sed -e "s/playground-.*_//"` + echo "$repo" + ;; + kdelibs_*|applications_*|kdegraphics_*|kdeedu_*|kdeutils_*|kdeaccessibility_*|kdemultimedia_*|kdegames_*|kdesdk_*|kdetoys_*|kdeadmin_*|kdenetwork_*|kdewebdev_*|frameworks_*|workspace_*|pim_*|calligra_*) + repo=`echo $1 | sed -e 's/[^_]*_//'` + echo "$repo" + ;; + kdereview_*) + repo=`echo $1 | sed -e 's/[^_]*_//'` + echo "$repo" + ;; + websites_*) + repo=`echo $1 | sed -e "s/websites_//"` + echo "$repo" + ;; + *) + echo "ERROR: $1 is not a git repo" +# exit 1 + ;; + esac +} + function get_url { + get_url_repo=`get_repo_name $1` case "$1" in kdelibs|kdeplasma-addons|kdepim-runtime|calligra|qt|kde-runtime|kde-workspace) echo "kde:$1.git" ;; kdesupport-phonon_*) - get_url_repo=`echo $1 | sed -e "s/kdesupport-phonon_//"` echo "kde:$get_url_repo.git" ;; extragear-*_*) - get_url_repo=`echo $1 | sed -e "s/extragear-.*_//"` echo "kde:$get_url_repo.git" ;; playground-*_*) - get_url_repo=`echo $1 | sed -e "s/playground-.*_//"` echo "kde:$get_url_repo.git" ;; kdelibs_*|applications_*|kdegraphics_*|kdeedu_*|kdeutils_*|kdeaccessibility_*|kdemultimedia_*|kdegames_*|kdesdk_*|kdetoys_*|kdeadmin_*|kdenetwork_*|kdewebdev_*|frameworks_*|workspace_*|pim_*|calligra_*) - get_url_repo=`echo $1 | sed -e 's/[^_]*_//'` echo "kde:$get_url_repo.git" ;; kdereview_*) - get_url_repo=`echo $1 | sed -e 's/[^_]*_//'` echo "kde:$get_url_repo.git" ;; websites_*) - get_url_repo=`echo $1 | sed -e "s/websites_//"` echo "kde:websites/$get_url_repo.git" ;; *) echo "ERROR: $1 is not a git repo" # exit 1 ;; esac } Index: trunk/l10n-kf5/scripts/update_translations =================================================================== --- trunk/l10n-kf5/scripts/update_translations (revision 1522574) +++ trunk/l10n-kf5/scripts/update_translations (revision 1522575) @@ -1,613 +1,614 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; # This script is run from kde-common/makemessages - not useful outside of it # Note to developers: # there are not many comments in this code to avoid to slow down the code # So please look also in the svn log to have comments about the code umask 022 postprocess_pot_file() { # $1: name of the file to process mv $1 $1.orig # sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n", ; s,"Content-Transfer-Encoding: ENCODING\\n","Content-Transfer-Encoding: 8bit\\n", ; s,"Language-Team: LANGUAGE \\n","Language-Team: LANGUAGE \\n",' < $1.orig > $1 sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n", ; s,"Language-Team: LANGUAGE \\n","Language-Team: LANGUAGE \\n",' < $1.orig > $1 rm -f $1.orig } pot_files_diff() { # $1 and $2 are the two .pot files to compare # We do not check: Content-Type, Content-Transfer-Encoding, POT-Creation-Date Language-Team diff -q -I^\"POT-Creation-Date: -I^\"Content-T -I^\"Language-Team: $1 $2 > /dev/null } update_translations() { echo "@@@ Processing branch $transmod ..." test -z "$TIMING1" || date if [ "x$DOOCBOOK_LOCATION" = "x" ]; then DOCBOOK_LOCATION=/usr/share/xml/docbook/schema/dtd/4.5/ fi if [ "x$DOOCBOOKXSL_LOCATION" = "x" ]; then DOCBOOKXSL_LOCATION=/usr/share/xml/docbook/stylesheet/nwalsh/ fi # no kde_qt in kf5 for i in $releases l10n; do vcs=`get_vcs $i` if test -n "$NOUPDATE"; then if test "$vcs" = git; then branch=`get_branch $i` i=`get_path $i` if ! (cd $i && git reset $SVNQUIETFLAG --hard origin/$branch); then echo "ERROR: failed to switch to $branch in $i" fi fi continue fi test -z "$VERBOSE1" || echo "updating $i" modname=$i i=`get_path $i` if test ! -d $i; then case "$vcs" in svn) mkdir -p $i svn co -q $SVNROOT/$i $i || echo "ERROR: checking out $i has failed!" ;; git) git clone -v --no-checkout $SVNQUIETFLAG `get_url $modname` $i || echo "ERROR: checking out $i has failed!" ;; *) echo "ERROR: unexpected VCS type?!" exit 1 ;; esac fi if cd $i; then if test "$vcs" = "git"; then # cleanup the old branches git remote prune origin || echo "ERROR: pruning $i has failed!" git fetch $SVNQUIETFLAG || echo "ERROR: fetching $i has failed!" branch=`get_branch $modname` fi ### TODO: perhaps we could combine cleanup/svn-clean/revert (One svn stat -u, if it fails cleanup and revert are called, otherwise only svn-cleanup is done.) if test -z "$NO_INITIAL_CLEANUP"; then case "$vcs" in svn) svn cleanup . perl $kdesdkscriptsdir/svn-clean -f | fgrep -v "Subversion working directory" | grep -v '^F' test -z "$VERBOSE1" || echo # revert all changes, so that the following "svn update" is without conflicts svn revert $SVNQUIETFLAG -R . ### TODO: do we need to revert the external directories of l10n too? (Are we modifying them at all?) ;; git) git clean -dxf $SVNQUIETFLAG ;; *) echo "ERROR: unexpected VCS type?!" exit 1 ;; esac fi # test -z $NO_INITIAL_CLEANUP test -z "$VERBOSE1" || echo case "$vcs" in svn) svn update $SVNQUIETFLAG || echo "ERROR: module $i was not correctly updated" ;; git) if ! git reset $SVNQUIETFLAG --hard origin/$branch; then echo "ERROR: failed to switch to branch $branch for module $modname." #FIXME I'd rather gracefully skip this module. but how? #perhaps I could filter $releases. findfiles could be trouble though. fi ;; *) echo "ERROR: unexpected VCS type?!" exit 1 ;; esac cd $BASEDIR else echo "ERROR: could not enter directory $i ! The module's update is SKIPPED!" fi done test -z "$VERBOSE1" || echo "finished updating" test -z "$TIMING1" || date rm -fr backup mkdir backup ### TODO: try to find a way to still use hardlinks cp -a $transmod/templates backup cp -a $transmod/en backup # Where are the tools needed for message extraction? extractrc=$kdesdkscriptsdir/extractrc extractattr=$kdesdkscriptsdir/extractattr extractqml=$kdesdkscriptsdir/extractqml extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kconfigwidgetsdir/src/preparetips5 repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl kdelibs= for logmod in $releases; do test -z "$NOXGETTEXT" || continue templatename=`get_po_path $logmod` mod=`get_path $logmod` rm -rf /tmp/cvslog.$logmod if cd $BASEDIR/$mod; then if test ! -d $BASEDIR/$transmod/templates/messages/$templatename; then if cd $BASEDIR/$transmod/templates/messages; then echo "creating templates directory for $templatename" mkdir $BASEDIR/backup/templates/messages/$templatename svn mkdir $templatename cd $BASEDIR/$mod else echo "SKIPPING $mod - no template directory!" continue fi fi test -z "$VERBOSE1" || echo "making messages in $mod" vcs=`get_vcs $logmod` branch=`get_branch $logmod` if test ! -d po; then modpodir=$BASEDIR/$transmod/templates/messages/$templatename echo "$logmod $modpodir" mkdir po enpo + repo_name=`get_repo_name $mod` ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ EXTRACTRC="perl $extractrc --ignore-no-input" \ EXTRACTATTR="perl $extractattr" \ EXTRACT_GRANTLEE_TEMPLATE_STRINGS="python $extractgrantlee" \ PREPARETIPS="perl $preparetips" \ REPACKPOT="perl $repackpot" \ - PACKAGE=$mod \ + PACKAGE=$repo_name \ IGNORE=".$vcs" \ bash $BASEDIR/$transmod/scripts/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ bash $BASEDIR/$transmod/scripts/extract-xml.sh) ( SUBMODULE=$templatename \ ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ EXTRACTRC="perl $extractrc --ignore-no-input" \ EXTRACTATTR="perl $extractattr" \ EXTRACT_GRANTLEE_TEMPLATE_STRINGS="python $extractgrantlee" \ PREPARETIPS="perl $preparetips" \ REPACKPOT="perl $repackpot" \ - PACKAGE=$mod \ + PACKAGE=$repo_name \ IGNORE=".$vcs" \ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ bash $BASEDIR/$transmod/scripts/process-static-messages.sh) rm -f messages.log # Move pot files to destination find po -name \*.pot | xargs -r mv -t $modpodir enpofiles=`find enpo -name \*.po` if test -n "$enpofiles"; then # Create the en destination folder if needed if test ! -d $BASEDIR/$transmod/en/messages/$templatename; then if cd $BASEDIR/$transmod/en/messages; then echo "creating en directory for $templatename" mkdir $BASEDIR/backup/en/messages/$templatename svn mkdir $templatename cd $BASEDIR/$mod else echo "SKIPPING $mod - no en directory!" continue fi fi # Move the en po files to destination find enpo -name \*.po | xargs -r mv -t $BASEDIR/$transmod/en/messages/$templatename fi xfiles=`find po -type f` if test -n "$xfiles"; then echo "Warning: some unexpected files created in po/ directory:" echo "$xfiles" fi xfiles=`find enpo -type f` if test -n "$xfiles"; then echo "Warning: some unexpected files created in enpo/ directory:" echo "$xfiles" fi rm -rf po enpo else echo "Warning: unexpected po/ directory found, skipping extraction. Extra info: $logmod | $templatename | $mod" fi case "$vcs" in svn) svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (after extraction)" > /dev/null ;; git) if git pull $SVNQUIETFLAG origin $branch; then status=`git status -s` if [ "x$status" != "x" ]; then if git commit -a $SVNQUIETFLAG -m "GIT_SILENT made messages (after extraction)"; then git push $SVNQUIETFLAG origin HEAD:$branch || echo "WARNING: commit failed in $mod" else echo "nothing to commit for $mod?" fi # See if we actually have to commit a new file, this seldom happens status=`git status -s` if [ "x$status" != "x" ]; then echo $status git add . if git commit -a $SVNQUIETFLAG -m "GIT_SILENT Add new file (after extraction)"; then git push $SVNQUIETFLAG origin HEAD:$branch || echo "WARNING: commit failed in $mod" else echo "nothing to commit for $mod?" fi fi fi else echo "WARNING: possible conflict in $mod" fi ;; *) echo "ERROR: unexpected VCS type?!" exit 1 ;; esac if cd $BASEDIR/$transmod/templates/messages/$templatename ; then for i in *.pot; do if test ! -f $i; then continue; fi if test ! -f $BASEDIR/backup/templates/messages/$templatename/$i ; then postprocess_pot_file $i echo "Adding .pot file: $i" svn add $i cp -f $i $BASEDIR/backup/templates/messages/$templatename/$i elif pot_files_diff $i $BASEDIR/backup/templates/messages/$templatename/$i > /dev/null ; then if test `stat -c %Y $i` -lt $STARTTIME; then cp -f -p $BASEDIR/backup/templates/messages/$templatename/$i $i else cp -f $BASEDIR/backup/templates/messages/$templatename/$i $i fi else postprocess_pot_file $i cp -f $i $BASEDIR/backup/templates/messages/$templatename/$i fi done cd $BASEDIR/$mod fi if cd $BASEDIR/$transmod/en/messages/$templatename &> /dev/null ; then for i in *.po; do if test ! -f $i; then continue; fi if test ! -f $BASEDIR/backup/en/messages/$templatename/$i ; then echo "Adding en .po file: $i" svn add $i cp -f $i $BASEDIR/backup/en/messages/$templatename/$i elif pot_files_diff $i $BASEDIR/backup/en/messages/$templatename/$i > /dev/null ; then if test `stat -c %Y $i` -lt $STARTTIME; then cp -f -p $BASEDIR/backup/en/messages/$templatename/$i $i else cp -f $BASEDIR/backup/en/messages/$templatename/$i $i fi else cp -f $i $BASEDIR/backup/en/messages/$templatename/$i fi done cd $BASEDIR/$mod fi rm -rf po.backup else echo "Failed to cd to $BASEDIR/$mod" fi done cd $BASEDIR test -z "$VERBOSE1" || echo "updating files in $transmod" if cd $transmod; then rm -f statuslist.tmp test -z "$VERBOSE1" || echo "adding missing templates" test -z "$TIMING1" || date list=`find templates/messages -name '*.pot'` for i in $list; do if test ! -f $BASEDIR/backup/$i; then postprocess_pot_file $i echo "Adding .pot file: $i (late)" svn add $i; cp -f $i $BASEDIR/backup/$i elif pot_files_diff $i $BASEDIR/backup/$i > /dev/null ; then stat -c "%Y %n" $i >> statuslist.tmp cp -fp $BASEDIR/backup/$i $i else postprocess_pot_file $i cp -f $i $BASEDIR/backup/$i fi; done test -z "$VERBOSE1" || echo "committing l10n/templates/messages" test -z "$TIMING1" || date svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (.pot file)" templates/messages > /dev/null if test -z "$NOXGETTEXT"; then echo "Potentially obsolete .pot files:" perl -n -e "use POSIX qw(strftime); /([0-9]+) (.+)/; if ( \$2 =~ m/\/(desktop|json)_.+\.pot/ ) {} elsif ( \$1 < $STARTTIME ) { print strftime (\"%Y-%m-%d\", gmtime(\$1)).\" \".\$2. \"\n\";}" < statuslist.tmp | sort echo "--- end of list ---" fi rm -f statuslist.tmp test -z "$VERBOSE1" || echo "reupdating l10n/templates/messages" test -z "$TIMING1" || date svn revert $SVNQUIETFLAG -R templates/messages svn update $SVNQUIETFLAG templates/messages | egrep -v "^(U | U|UU) " # Note the -type f in the following find is needed to exclude the names of the "pruned" directories find templates/messages \( -name .svn -prune -o -name "*.pot" \) -type f -printf "%f\\n" | sort | uniq -d > templatenames.tmp if test -s templatenames.tmp; then echo "ERROR: there are duplicated POT files:" cat templatenames.tmp echo "--- end duplicated POT files ---" fi rm -f templatenames.tmp # Create the all_files_* files bash scripts/findfiles `pwd`/all_files echo "creating desktop*.pot files" test -z "$TIMING1" || date bash scripts/create_desktop_files.sh echo "commiting desktop*.pot files" test -z "$TIMING1" || date if cd templates/messages; then list=`find . -name desktop\*.pot` # desktop*.pot files have already a correct Content-Type, so we do not need to check it or even to modify it for i in $list; do if test ! -f $BASEDIR/backup/templates/messages/$i; then echo "Adding desktop*.pot file: $i" svn add $i; elif ! test $i -nt $BASEDIR/backup/templates/messages/$i; then echo "$i was not regenerated. Probably needs to be removed" elif pot_files_diff $i $BASEDIR/backup/templates/messages/$i > /dev/null ; then cp -f $BASEDIR/backup/templates/messages/$i $i fi done svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (desktop*.pot file committed)" > /dev/null cd ../.. fi echo "creating json*.pot files" test -z "$TIMING1" || date ( L10NDIR=$BASEDIR/$transmod \ bash $BASEDIR/$transmod/scripts/handle_json_files.sh) echo "commiting json*.pot files" test -z "$TIMING1" || date if cd templates/messages; then list=$(find . -name json\*.pot) for i in $list; do if test ! -f $BASEDIR/backup/templates/messages/$i; then echo "Adding json*.pot file: $i" svn add $i; elif ! test $i -nt $BASEDIR/backup/templates/messages/$i; then echo "$i was not regenerated. Probably needs to be removed" elif pot_files_diff $i $BASEDIR/backup/templates/messages/$i > /dev/null ; then cp -f $BASEDIR/backup/templates/messages/$i $i fi done svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (json*.pot file committed)" > /dev/null cd ../.. fi rm -fr $BASEDIR/backup echo "%% Creating documentation templates begin" sed s#@DocBookXML4_DTD_DIR@#$DOCBOOK_LOCATION#g $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd.cmake > $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd sed s#@DOCBOOKXSL_DIR@#$DOCBOOKXSL_LOCATION#g $kdoctoolsdir/src/customization/kde-include-common.xsl.cmake > $kdoctoolsdir/src/customization/kde-include-common.xsl sed s#@DOCBOOKXSL_DIR@#$DOCBOOKXSL_LOCATION#g $kdoctoolsdir/src/customization/kde-include-man.xsl.cmake > $kdoctoolsdir/src/customization/kde-include-man.xsl docbookl10nhelper $DOCBOOKXSL_LOCATION $kdoctoolsdir/src/customization/xsl/ $kdoctoolsdir/src/customization/xsl/ # Hack: meinproc5 uses QStandardDirs and it looks for files in # kf5/kdoctools from XDG_DATA_DIRS OLD_XDG_DATA_DIRS=$XDG_DATA_DIRS TMP_XDG_DIR=`pwd`/tmpxdg KDOCTOOLS_DATA_DIR=$TMP_XDG_DIR/kf5/kdoctools [ ! -d $KDOCTOOLS_DATA_DIR ] && mkdir -p $KDOCTOOLS_DATA_DIR ln -s $kdoctoolsdir/src/customization $KDOCTOOLS_DATA_DIR export XDG_DATA_DIRS=$TMP_XDG_DIR:$XDG_DATA_DIRS bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd export XDG_DATA_DIRS=$OLD_XDG_DATA_DIRS rm -f $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd \ $kdoctoolsdir/src/customization/kde-include-common.xsl \ $kdoctoolsdir/src/customization/kde-include-man.xsl \ $kdoctoolsdir/src/customization/xsl/all-l10n.xml \ $kdoctoolsdir/src/customization/xsl/kde-custom-l10n.xml \ $KDOCTOOLS_DATA_DIR/customization rm -rf $TMP_XDG_DIR echo "%% Creating documentation templates end" test -z "$VERBOSE1" || echo "checking svn:executable in l10n" test -z "$TIMING1" || date # try to find all "executable" PO, POT, PNG, JPEG, DocBook, WAV, OGG, SVG, SVGZ files and remove the svn:executable property find . \( -name .svn -o -name documentation \) -prune , -type f \( -name \*.po -o -name \*.pot -o -name \*.png -o -name \*.jpeg -o -name \*.jpg -o -name \*.docbook -o -name \*.wav -o -name \*.ogg -o -name \*.svg -o -name \*.svgz \) -perm -u+x | xargs --no-run-if-empty svn propdel svn:executable svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (svn:executable)" test -z "$VERBOSE1" || echo "reupdating l10n" test -z "$TIMING1" || date svn cleanup svn update $SVNQUIETFLAG | egrep -v "^(U | U|UU) " # clear conflicts by using "svn revert" svn revert $SVNQUIETFLAG -R . echo echo "%% TRANSLATOR START $transmod" echo bash scripts/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo test -z "$VERBOSE1" || echo "Preparing to commit new files" test -z "$TIMING1" || date # SVN 1.2.3: svn status without parameters has not changed its output format list=`svn status | fgrep -v "Performing" | cut -b8-` for i in $list; do if test ! -s $i; then svn revert $SVNQUIETFLAG $i fi done # Note: we assume here that names of PO files never start with a digit # SVN 1.2.3: svn stat -u has still the modified-on-server flag at the 8th column, followed by a revision number and the file name svn status --show-updates | perl -n -e "if ( /^Performing/ ) { } elsif ( /^.{7}\*\s+[0-9]*\s+([^0-9].+)/ ) { print \$1.\"\n\"; }" > ../conflicts.tmp if test -s ../conflicts.tmp; then for i in `cat ../conflicts.tmp`; do if test -f $i; then test -z "$VERBOSE" || echo "File was updated on server: $i" svn revert $SVNQUIETFLAG $i elif test -d $i; then echo "Directory was updated on server: $i" # If the file was modified locally and on the server, we have to revert the local change # Note: we assume here that names of PO files never start with a digit ### TODO: what about property changes on server # SVN 1.2.3: svn stat -u has still the modified flag at the 1st column, the modified-on-server flag at the 8th column, followed by a revision number and the file name svn status --show-updates $i | perl -n -e "if ( /^Performing/ ) { } elsif ( /^M.{6}\*\s+[0-9]*\s+([^0-9].+)/ ) { print \$1.\"\n\"; }" > ../dir_conflicts.tmp fgrep -v .svn ../dir_conflicts.tmp | xargs --no-run-if-empty rm -v svn update $SVNQUIETFLAG $i elif test ! -e $i; then # We do not know the file yet, so no need to do anything echo "New file on server: $i" else # As we do not know what we got, try to get as much information as possible echo "Unknown file type, updated on server: $i" svn status --verbose --show-updates $i svn revert $i fi done fi rm -f ../conflicts.tmp ../dir_conflicts.tmp test -z "$VERBOSE1" || echo "commiting new files" test -z "$TIMING1" || date if ! svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (.po file)" > /dev/null; then test -z "$VERBOSE1" || echo "commiting new files, second try" test -z "$TIMING1" || date ### TODO: find a good way to avoid using the subdirs file for i in `cat subdirs`; do if cd $i; then if ! svn commit $SVNQUIETFLAG -m "SVN_SILENT made messages (.po file, second try)"; then echo "Could not commit l10n/$i . Reverting!" svn revert $SVNQUIETFLAG -R . fi cd .. else echo "Cannot commit, unknown directory l10n/$i" fi done fi cd $BASEDIR fi if true; then if cd $transmod; then echo "applying desktop file translations" test -z "$TIMING1" || date bash scripts/merge_desktop_files.sh cd $BASEDIR fi echo "commiting desktop files" test -z "$TIMING1" || date for i in $releases l10n; do if cd $BASEDIR/`get_path $i`; then vcs=`get_vcs $i` branch=`get_branch $i` case "$vcs" in svn) if ! svn commit $SVNQUIETFLAG -m $'SVN_SILENT made messages (.desktop file) - always resolve mine-conflict\n\nIn case of conflict in i18n, keep the version of the branch "--accept mine-conflict"\nTo resolve a particular conflict, "svn resolve --accept mine-full path/to/file.desktop"' > /dev/null; then # If the commit fails, then it means that a file was modified. Normally it will not be a .desktop file echo "Need to update $i" svn update $SVNQUIETFLAG if ! svn commit $SVNQUIETFLAG -m $'SVN_SILENT made messages (.desktop file, second try) - always resolve mine-conflict\n\nIn case of conflict in i18n, keep the version of the branch "--accept mine-conflict"\nTo resolve a particular conflict, "svn resolve --accept mine-full path/to/file.desktop"'; then echo "ERROR: commiting .desktop files failed for module $i!" svn revert -R . fi fi ;; git) if git pull $SVNQUIETFLAG origin $branch; then status=`git status -s` if [ "x$status" != "x" ]; then if git commit -a $SVNQUIETFLAG -m $'SVN_SILENT made messages (.desktop file) - always resolve ours\n\nIn case of conflict in i18n, keep the version of the branch "ours"\nTo resolve a particular conflict, "git checkout --ours path/to/file.desktop"'; then if ! git push $SVNQUIETFLAG origin HEAD:$branch; then echo "ERROR: commiting .desktop files failed for module $i!" git reset --hard $SVNQUIETFLAG origin/$branch fi else echo "nothing to commit for $i?" fi fi else echo "ERROR: commiting .desktop files failed for module $i (possible conflict)" git reset --hard $SVNQUIETFLAG origin/$branch fi ;; *) echo "ERROR: unexpected VCS type?!" exit 1 ;; esac fi done else echo "Skipping processing of .desktop files" fi rm -rf all_files* messages cd $BASEDIR if cd $transmod; then echo "%% Updating x-test begin" bash x-test/internal/update_xx.sh svn commit x-test $SVNQUIETFLAG -m "SVN_SILENT made messages (x-test)" echo "%% Updating x-test end" echo "%% Finding po without pot begin" bash ./scripts/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" kdoctoolsdir=$kdoctoolsdir bash ./scripts/checkdocs.sh --optimized echo "%% Checking language docs are valid end" cd $BASEDIR fi echo "@@@ branch $transmod processed!" test -z "$TIMING1" || date } # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only dir=`dirname $0` . $dir/get_paths transmod=`get_path l10n` releases=`list_modules $dir` kconfigwidgetsdir=$BASEDIR/`get_path frameworks_kconfigwidgets` kdoctoolsdir=$BASEDIR/`get_path frameworks_kdoctools` kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts` update_translations