Package: intltool-debian
Version: 0.34.1+20050828
Severity: wishlist
Tags: patch

In some unusual circumstances, it's useful to have a debconf template
with an empty short description, but still have an extended description
with translatable text. I'm doing this in the Ubuntu live installer,
which (among other tricks) stores translations of GTK labels in the
debconf database; in many cases it doesn't really make sense to have a
short description here.

Unfortunately, intltool-merge sees the empty short description, observes
correctly that the empty string is untranslated, and then ignores the
translations of the extended description.

The attached patch makes intltool-debian check for translations of the
extended description before deciding that an empty short description
means that the whole description is untranslated. I'm afraid the patch
is against an older version than Debian unstable because that's what we
have in Ubuntu dapper at present, so that's what I've tested; if you
want me to port it to the current version, let me know.

Thanks,

-- 
Colin Watson                                       [EMAIL PROTECTED]
diff -Nru 
/tmp/U77I1znB5H/intltool-debian-0.34.1+20050828/intltool-bin/intltool-merge 
/tmp/nzyNOlNGf6/intltool-debian-0.34.1+20050828ubuntu1/intltool-bin/intltool-merge
--- /tmp/U77I1znB5H/intltool-debian-0.34.1+20050828/intltool-bin/intltool-merge 
2005-08-27 23:45:20.000000000 +0100
+++ 
/tmp/nzyNOlNGf6/intltool-debian-0.34.1+20050828ubuntu1/intltool-bin/intltool-merge
  2006-03-20 13:03:20.000000000 +0000
@@ -1259,7 +1259,11 @@
                     {
                         my $translation = $translations{$lang, $str};
                     
-                        if (!$translation) 
+                        if ($first && @str_list > 1 && $str eq '')
+                        {
+                            $translation = '';
+                        }
+                        elsif (!$translation) 
                         {
                             $is_translated = 0;
                             last;
diff -Nru 
/tmp/U77I1znB5H/intltool-debian-0.34.1+20050828/intltool-patches/intltool-merge.patch
 
/tmp/nzyNOlNGf6/intltool-debian-0.34.1+20050828ubuntu1/intltool-patches/intltool-merge.patch
--- 
/tmp/U77I1znB5H/intltool-debian-0.34.1+20050828/intltool-patches/intltool-merge.patch
       2005-08-27 23:45:31.000000000 +0100
+++ 
/tmp/nzyNOlNGf6/intltool-debian-0.34.1+20050828ubuntu1/intltool-patches/intltool-merge.patch
        2006-03-20 13:16:48.000000000 +0000
@@ -51,7 +51,20 @@
            #  Remove [] dummy strings
            my $stripped = $string;
            $stripped =~ s/\[\s[^\[\]]*\],/,/g if $underscore eq 2;
-@@ -1253,9 +1268,17 @@
+@@ -1244,7 +1259,11 @@
+                     {
+                         my $translation = $translations{$lang, $str};
+                     
+-                        if (!$translation) 
++                        if ($first && @str_list > 1 && $str eq '')
++                        {
++                            $translation = '';
++                        }
++                        elsif (!$translation) 
+                         {
+                             $is_translated = 0;
+                             last;
+@@ -1253,9 +1272,17 @@
                        #  $translation may also contain [] dummy
                          #  strings, mostly to indicate an empty string
                        $translation =~ s/\[\s[^\[\]]*\]$//;
@@ -69,7 +82,7 @@
                              if ($underscore eq 2)
                              {
                                  $str_translated .= $translation;
-@@ -1284,6 +1307,7 @@
+@@ -1284,6 +1311,7 @@
  
                          #  To fix some problems with Text::Wrap::wrap
                          $str_translated =~ s/(\n )+\n/\n .\n/g;
@@ -77,7 +90,7 @@
                      }
                      next unless $is_translated;
  
-@@ -1316,7 +1340,16 @@
+@@ -1316,7 +1344,16 @@
      my $type = shift;
      my $text = shift;
      $text =~ s/^[ \t]//mg;

Reply via email to