Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-devtools for openSUSE:Factory checked in at 2022-05-18 13:12:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-devtools (Old) and /work/SRC/openSUSE:Factory/.yast2-devtools.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-devtools" Wed May 18 13:12:56 2022 rev:106 rq:977765 version:4.5.4 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-devtools/yast2-devtools.changes 2022-04-28 23:07:16.124641765 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-devtools.new.1538/yast2-devtools.changes 2022-05-18 13:13:07.770659429 +0200 @@ -1,0 +2,7 @@ +Mon May 16 07:03:10 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> + +- Extract the translatable strings also from the Qt *.ui files + (bsc#1198097) +- 4.5.4 + +------------------------------------------------------------------- Old: ---- yast2-devtools-4.5.3.tar.bz2 New: ---- yast2-devtools-4.5.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-devtools.spec ++++++ --- /var/tmp/diff_new_pack.XF68t7/_old 2022-05-18 13:13:08.322659915 +0200 +++ /var/tmp/diff_new_pack.XF68t7/_new 2022-05-18 13:13:08.326659919 +0200 @@ -17,7 +17,7 @@ Name: yast2-devtools -Version: 4.5.3 +Version: 4.5.4 Release: 0 Summary: YaST2 - Development Tools License: GPL-2.0-or-later @@ -132,6 +132,7 @@ %{_datadir}/YaST2/data/devtools/data/rubocop*_yast_style.yml %dir %{_datadir}/YaST2/control/ %{_datadir}/YaST2/control/yast_control.its +%{_datadir}/YaST2/control/qt_ui.its %files -n yast2-buildtools %{_rpmmacrodir}/macros.yast ++++++ yast2-devtools-4.5.3.tar.bz2 -> yast2-devtools-4.5.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/build-tools/scripts/Makefile.am new/yast2-devtools-4.5.4/build-tools/scripts/Makefile.am --- old/yast2-devtools-4.5.3/build-tools/scripts/Makefile.am 2022-04-26 17:57:25.000000000 +0200 +++ new/yast2-devtools-4.5.4/build-tools/scripts/Makefile.am 2022-05-17 14:42:09.000000000 +0200 @@ -16,4 +16,4 @@ # sourced by 'check-textdomain' and 'y2makepot'. dist_pkgdata_DATA = gettextdomains -dist_control_DATA = yast_control.its +dist_control_DATA = yast_control.its qt_ui.its diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/build-tools/scripts/gettextdomains new/yast2-devtools-4.5.4/build-tools/scripts/gettextdomains --- old/yast2-devtools-4.5.3/build-tools/scripts/gettextdomains 2022-04-26 17:57:25.000000000 +0200 +++ new/yast2-devtools-4.5.4/build-tools/scripts/gettextdomains 2022-05-17 14:42:09.000000000 +0200 @@ -1,5 +1,18 @@ ### sourced by 'check-textdomain' and 'y2makepot' ### -*- sh -*- +# Try reading the default text domain from the TEXTDOMAIN file +# Argument: $1 -> directory to search +# $F -> the source file +# Returns: $D -> the found text domain +function default_textdomain() +{ + local TD="$1/TEXTDOMAIN" + if [ -f "$TD" ]; then + echo "File $F: Using default text domain from $TD" + D=`cat "$TD"` + fi +} + # # get_domains_and_err(): # Argument: $1 -> directory to search @@ -26,6 +39,7 @@ -o -name "*.cpp" \ -o -name "*.erb" \ -o -name "*.glade" \ + -o -name "*.ui" \ -o -name "*.ycontrol.xml" \ -o -name "*.ycontrol.xsl" \ -o -name "*.rb" ` @@ -49,7 +63,7 @@ # - false matches of comments inside strings # - uncaught _( at line beginning MATCH=`perl -n -e 'print "$ARGV: $_" if not /(^\s*\/\/|^\s*#[^\{])/' $F | \ - perl -n -e 'print "$_" if /<label>|[^[:alnum:]_"<](_|__|gettext)\(/../\)/'` + perl -n -e 'print "$_" if /<label>|<property\s+name\s*=\s*"text"|[^[:alnum:]_"<](_|__|gettext)\(/../\)/'` if [ -n "$MATCH" ]; then TR_FILES="$F $TR_FILES" ; fi @@ -63,7 +77,22 @@ D=`egrep '^[[:space:]]*<?[Tt]extdomain>?' $F | head -n 1 | \ sed 's/^[[:space:]]*<\?[Tt]extdomain[[:space:]]*[=: \ '\''"(>]*[[:space:]]*\([-_[:alnum:]]*\).*/\1/'`; - if [ -z $D ]; then + # if the text domain is not specified directly in the file then + # search for the TEXTDOMAIN file in the source directory or in its parents + if [ -z "$D" ]; then + DIR=`dirname "$F"` + # search in the parent dirs + while [ -z "$D" -a "$DIR" != "." ]; do + default_textdomain "$DIR" + DIR=`dirname "$DIR"` + done + # search in the top level dir + if [ -z "$D" ]; then + default_textdomain "$DIR" + fi + fi + + if [ -z "$D" ]; then ERR="$PWD/$F $ERR" ; else DOMAINS="$D:$F\n$DOMAINS" ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/build-tools/scripts/qt_ui.its new/yast2-devtools-4.5.4/build-tools/scripts/qt_ui.its --- old/yast2-devtools-4.5.3/build-tools/scripts/qt_ui.its 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-devtools-4.5.4/build-tools/scripts/qt_ui.its 2022-05-17 14:42:09.000000000 +0200 @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<!-- Gettext rules for extracting the translatable strings from Qt UI files --> +<!-- see https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html --> +<!-- see https://www.w3.org/TR/its20/ --> +<its:rules xmlns:its="http://www.w3.org/2005/11/its" + xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0" + version="2.0"> + + <!-- by default all texts in file are translated, disable translations for all nodes below the root <ui> --> + <its:translateRule selector="/ui" + translate="no"/> + <!-- translate only the texts in the text widget propertes anywhere --> + <its:translateRule selector="//widget/property[@name='text']/string" + translate="yes"/> + <!-- gettext extension: disable escaping of special XML characters like "&" in the texts --> + <gt:escapeRule selector="//widget/property[@name='text']/string" escape="no"/> + <!-- gettext extension: trim the leading and trailing whitespace but keep it in the middle --> + <gt:preserveSpaceRule selector="//widget/property[@name='text']/string" space="trim"/> + +</its:rules> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/build-tools/scripts/y2makepot new/yast2-devtools-4.5.4/build-tools/scripts/y2makepot --- old/yast2-devtools-4.5.3/build-tools/scripts/y2makepot 2022-04-26 17:57:25.000000000 +0200 +++ new/yast2-devtools-4.5.4/build-tools/scripts/y2makepot 2022-05-17 14:42:09.000000000 +0200 @@ -26,6 +26,39 @@ else CONTROL_ITS="/usr/share/YaST2/control/yast_control.its" fi +if [ -f "$CWD/qt_ui.its" ]; then + UI_ITS="$CWD/qt_ui.its" +else + UI_ITS="/usr/share/YaST2/control/qt_ui.its" +fi + +function add_xml_translations() +{ + XML_FILES=$1 + ITS_FILE=$2 + + if [ -n "$XML_FILES" ]; then + # a POT file was created from other files, we need to do the merge + if [ -f "$MODULE.pot" ]; then + mv "$MODULE.pot" "$MODULE.other.pot" + xgettext_call "$MODULE" "$XML_FILES" "--omit-header --its=$ITS_FILE" + if [ -f "$MODULE.pot" ]; then + # new file was created, merge the files + mv "$MODULE.pot" "$MODULE.xml.pot" + echo "Merging the .pot files..." + msgcat -o "$MODULE.pot" "$MODULE.other.pot" "$MODULE.xml.pot" + rm "$MODULE.xml.pot" "$MODULE.other.pot" + else + # no new file created, just rename it back + mv "$MODULE.other.pot" "$MODULE.pot" + fi + else + # no merge needed, just run gettext and that's it + xgettext_call "$MODULE" "$XML_FILES" "--its=$ITS_FILE" + fi + fi + +} function gettext_call() { @@ -33,6 +66,7 @@ SOURCE_FILES=$2 SOURCE_RUBY_FILES=$3 SOURCE_CONTROL_FILES=$4 + SOURCE_UI_FILES=$5 # remove the old file rm -f "$MODULE.pot" @@ -57,26 +91,8 @@ rxgettext_call "$MODULE" "$SOURCE_RUBY_FILES" fi - if [ -n "$SOURCE_CONTROL_FILES" ]; then - # a POT file was created from other files, we need to do the merge - if [ -f "$MODULE.pot" ]; then - mv "$MODULE.pot" "$MODULE.other.pot" - xgettext_call "$MODULE" "$SOURCE_CONTROL_FILES" "--omit-header --its=$CONTROL_ITS" - if [ -f "$MODULE.pot" ]; then - # new file was created, merge the files - mv "$MODULE.pot" "$MODULE.control.pot" - echo "Merging the .pot files..." - msgcat -o "$MODULE.pot" "$MODULE.other.pot" "$MODULE.control.pot" - rm "$MODULE.control.pot" "$MODULE.other.pot" - else - # no new file created, just rename it back - mv "$MODULE.other.pot" "$MODULE.pot" - fi - else - # no merge needed, just run gettext and that's it - xgettext_call "$MODULE" "$SOURCE_CONTROL_FILES" "--its=$CONTROL_ITS" - fi - fi + add_xml_translations "$SOURCE_CONTROL_FILES" "$CONTROL_ITS" + add_xml_translations "$SOURCE_UI_FILES" "$UI_ITS" } function xgettext_call() @@ -178,6 +194,7 @@ FILES=""; RUBY_FILES="" CONTROL_FILES="" + UI_FILES="" for I in $DOMAINS; do D=${I%%:*} ; @@ -196,24 +213,24 @@ # is it a Ruby file? if [[ "$F" =~ \.(erb|rb)$ ]]; then RUBY_FILES="$RUBY_FILES $F"; - else + elif [[ "$F" =~ \.glade$ || "$F" =~ \.ycontrol.x[ms]l$ ]]; then # TODO: later remove support for the .glade workaround, # it is kept just for the backward compatibility - if [[ "$F" =~ \.glade$ || "$F" =~ \.ycontrol.x[ms]l$ ]]; then - # follow symlinks to have correct file locations - if [ -L "$F" ]; then - CONTROL_FILES="$CONTROL_FILES `realpath --relative-to=. \"$F\"`"; - else - CONTROL_FILES="$CONTROL_FILES $F"; - fi + # follow symlinks to have correct file locations + if [ -L "$F" ]; then + CONTROL_FILES="$CONTROL_FILES `realpath --relative-to=. \"$F\"`"; else - FILES="$FILES $F" ; + CONTROL_FILES="$CONTROL_FILES $F"; fi + elif [[ "$F" =~ \.ui$ ]]; then + UI_FILES="$UI_FILES $F" + else + FILES="$FILES $F" ; fi done POT_DST="$POT_DST $MODULE.pot" - gettext_call "$MODULE" "$FILES" "$RUBY_FILES" "$CONTROL_FILES" + gettext_call "$MODULE" "$FILES" "$RUBY_FILES" "$CONTROL_FILES" "$UI_FILES" } # -- function defininitions -- end --------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/package/yast2-devtools.changes new/yast2-devtools-4.5.4/package/yast2-devtools.changes --- old/yast2-devtools-4.5.3/package/yast2-devtools.changes 2022-04-26 17:57:25.000000000 +0200 +++ new/yast2-devtools-4.5.4/package/yast2-devtools.changes 2022-05-17 14:42:09.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon May 16 07:03:10 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> + +- Extract the translatable strings also from the Qt *.ui files + (bsc#1198097) +- 4.5.4 + +------------------------------------------------------------------- Thu Apr 21 12:32:14 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> - Generate correct source location for POT messages extracted diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-devtools-4.5.3/package/yast2-devtools.spec new/yast2-devtools-4.5.4/package/yast2-devtools.spec --- old/yast2-devtools-4.5.3/package/yast2-devtools.spec 2022-04-26 17:57:25.000000000 +0200 +++ new/yast2-devtools-4.5.4/package/yast2-devtools.spec 2022-05-17 14:42:09.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-devtools -Version: 4.5.3 +Version: 4.5.4 Release: 0 Summary: YaST2 - Development Tools License: GPL-2.0-or-later @@ -131,6 +131,7 @@ %{_datadir}/YaST2/data/devtools/data/rubocop*_yast_style.yml %dir %{_datadir}/YaST2/control/ %{_datadir}/YaST2/control/yast_control.its +%{_datadir}/YaST2/control/qt_ui.its %files -n yast2-buildtools %{_rpmmacrodir}/macros.yast