[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ideas wrt debconf templates checks



On Thu, Jul 03, 2008 at 07:03:02AM +0200, Christian Perrier wrote:
> Some people suggested /me to propose a check for incomplete
> translations: have lintian warn if one of the files in debian/po is
> not fully translated. While possible, I think this would have the
> negative effect that maintainers would be tempted to remove it to make
> their package "lintian clean"...which is not what they should do.
> 
> However, if *all* files are incomplete, it is very likely that the
> maintainer indeed changed something in the debconf templates and did
> not care (or did not take time) to send a call for translations.

I don't think incomplete translations are a problem, but reminding
maintainers if all files are incomplete (or if there are no translations
at all) isn't such a bad idea. Though I would make it an info/wishlist
tag, not a warning.

See attached patch.
diff --git a/checks/po-debconf b/checks/po-debconf
index fd97f61..371a063 100644
--- a/checks/po-debconf
+++ b/checks/po-debconf
@@ -28,6 +28,8 @@ sub run {
 my $pkg = shift;
 my $type = shift;
 
+my $full_translation = 0;
+
 # First, check wether this package seems to use debconf but not po-debconf.
 # Read the templates file and look at the template names it provides, since
 # some shared templates aren't translated.
@@ -155,8 +157,15 @@ while (defined(my $file=readdir(DEBIAN))) {
                 unless length($charset);
 	system_env("msgfmt -o /dev/null debfiles/po/$file 2>/dev/null") == 0
 		or tag "invalid-po-file", "debian/po/$file";
+
+	my $stats = `LANG=C msgfmt -o /dev/null --statistics debfiles/po/$file 2>&1`;
+	if (!$full_translation && $stats =~ m/^\w+ \w+ \w+\.$/) {
+		$full_translation = 1;
+	}
 }
 
+tag "no-complete-translation", "" if !$full_translation;
+
 }
 
 1;
diff --git a/checks/po-debconf.desc b/checks/po-debconf.desc
index bd14598..1f4b9f8 100644
--- a/checks/po-debconf.desc
+++ b/checks/po-debconf.desc
@@ -89,3 +89,10 @@ Info: You should not mark as translatable "Default:" or "DefaultChoice:"
  .
    _Default: English[ Default language name, but not translated]
 Ref: po-debconf(7)
+
+Tag: no-complete-translation
+Type: info
+Info: Even though this package provides translation support, there are no
+ translations or none of the translations are complete. This may mean that
+ translators weren't properly warned about the new strings.
+Ref: devref 6.5.2.2

Reply to: