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

lintian: r755 - in trunk: checks debian testset testset/debconf/debian



Author: rra
Date: 2006-09-27 06:47:01 +0200 (Wed, 27 Sep 2006)
New Revision: 755

Modified:
   trunk/checks/debconf
   trunk/checks/debconf.desc
   trunk/checks/po-debconf
   trunk/checks/po-debconf.desc
   trunk/debian/changelog
   trunk/testset/debconf/debian/debconf-test.templates
   trunk/testset/tags.debconf
Log:
  + [RA] Remove select-with-translated-default-field since there are
    cases where this is correct and we can perform a better check
    against the source package.  Patch from Thomas Huriaux.
  + [RA] Fix Perl warnings when a template has no type.
  + [RA] Check templates for a translatable Default or DefaultChoice
    field and warn if there isn't a translator comment.  Patch from
    Thomas Huriaux.  (Closes: #388824)

Modified: trunk/checks/debconf
===================================================================
--- trunk/checks/debconf	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/checks/debconf	2006-09-27 04:47:01 UTC (rev 755)
@@ -215,10 +215,6 @@
 	# Tests on translations
 	my ($mainfield, $lang) = split m/-/, $field, 2;
 	if (defined $lang) {
-	    if ($isselect and $mainfield eq 'default') {
-	        tag "select-with-translated-default-field",
-	              "$template->{template} $lang";
-	    }
 	    $languages{$lang}{$mainfield}=1;
 	}
 	unless ($template_fields{$mainfield}) { # Ignore language codes here
@@ -255,8 +251,9 @@
     } else {
         ($short, $extended) = ('', '');
     }
+    my $type = $template->{type} || '';
     unless ($short =~ /for internal use/i) {
-	my $isprompt = grep { $_ eq $template->{type} } qw(string select password multiselect);
+	my $isprompt = grep { $_ eq $type } qw(string select password multiselect);
 	if ($isprompt) {
 	    if ($short && $short !~ m/:$/) {
 		tag "malformed-prompt-in-templates", $template->{template};
@@ -265,7 +262,7 @@
 		tag "using-imperative-form-in-templates", $template->{template};
 	    }
 	}
-	if ($template->{type} eq 'boolean') {
+	if ($type eq 'boolean') {
 	    if ($short !~ /\?/) {
 		tag "malformed-question-in-templates", $template->{template};
 	    }
@@ -273,7 +270,7 @@
 		tag "using-question-in-extended-description-in-templates", $template->{template};
 	    }
 	}
-	if ($template->{type} eq 'note') {
+	if ($type eq 'note') {
 	    if ($short =~ /[.?;:]$/) {
 		tag "malformed-title-in-templates", $template->{template};
 	    }

Modified: trunk/checks/debconf.desc
===================================================================
--- trunk/checks/debconf.desc	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/checks/debconf.desc	2006-09-27 04:47:01 UTC (rev 755)
@@ -87,11 +87,6 @@
  is a duplicate of the short description. If you cannot provide a good
  extended description, it is better to leave it blank.
 
-Tag: select-with-translated-default-field
-Type: warning
-Info: You do not need to translate `Default:' fields of `select' or
- `multiselect' questions in templates.
-
 Tag: partially-translated-question
 Type: warning
 Info: If you translate the `Choices:' fields in a template, you should

Modified: trunk/checks/po-debconf
===================================================================
--- trunk/checks/po-debconf	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/checks/po-debconf	2006-09-27 04:47:01 UTC (rev 755)
@@ -38,6 +38,13 @@
 	        $has_template = 1;
 		if ($file =~ m/templates\.\w\w(_\w\w)?$/) {
 			push (@lang_templates, $file);
+		} else {
+			open(PO, "< debfiles/$file")
+				or fail("Can't open debfiles/$file file.");
+			while (<PO>) {
+				tag "translated-default-field", "$file: $."
+					if (m/^_Default(Choice)?: [^[]*$/);
+			}
 		}
 	}
 }

Modified: trunk/checks/po-debconf.desc
===================================================================
--- trunk/checks/po-debconf.desc	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/checks/po-debconf.desc	2006-09-27 04:47:01 UTC (rev 755)
@@ -63,3 +63,14 @@
  This can be ensured by running debconf-updatepo in the 'clean' target
  of <tt>debian/rules</tt>. PO files will then always be up-to-date when
  building the source package.
+
+Tag: translated-default-field
+Type: warning
+Info: You should not mark as translatable "Default:" or "DefaultChoice:"
+ fields, unless explicitly needed (e.g. default country, default language,
+ etc.).  If this Default field really should be translated, you should
+ explain translators how they should translate it by using brackets.  For
+ example:
+ .
+   _Default: English[ Default language name, but not translated]
+Ref: po-debconf(7)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/debian/changelog	2006-09-27 04:47:01 UTC (rev 755)
@@ -3,6 +3,10 @@
   * checks/debconf:
     + [CW] Don't trigger partially-translated-question when Choices-C exists
       but not Description-C.
+    + [RA] Remove select-with-translated-default-field since there are
+      cases where this is correct and we can perform a better check
+      against the source package.  Patch from Thomas Huriaux.
+    + [RA] Fix Perl warnings when a template has no type.
   * checks/debdiff:
     + [RA] Remove the source-tar-is-posix-tar tag.  This was only a
       problem for woody and earlier, and woody support is no longer
@@ -24,6 +28,9 @@
   * checks/po-debconf:
     + [RA] Avoid Perl warnings on .po files that don't contain msgstr
       lines.  Patch from Thomas Huriaux.  (Closes: #387357)
+    + [RA] Check templates for a translatable Default or DefaultChoice
+      field and warn if there isn't a translator comment.  Patch from
+      Thomas Huriaux.  (Closes: #388824)
   * checks/scripts:
     + [RA] Add /usr/bin/gosh from the gauche package to the list of valid
       interpreters.  Thanks, Tatsuya Kinoshita.  (Closes: #386798)
@@ -55,7 +62,7 @@
     + [RA] Document setting TMPDIR to change the location of lintian's
       temporary lab.  (Closes: #388786)
 
- -- Russ Allbery <rra@debian.org>  Tue, 26 Sep 2006 20:43:59 -0700
+ -- Russ Allbery <rra@debian.org>  Tue, 26 Sep 2006 21:25:03 -0700
 
 lintian (1.23.24) unstable; urgency=low
 

Modified: trunk/testset/debconf/debian/debconf-test.templates
===================================================================
--- trunk/testset/debconf/debian/debconf-test.templates	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/testset/debconf/debian/debconf-test.templates	2006-09-27 04:47:01 UTC (rev 755)
@@ -56,3 +56,24 @@
 
 Template: debconf/no-description
 Type: string
+
+Template: debconf/translate
+Type: boolean
+_Default: false
+_Description: Should this really be translated?
+
+Template: debconf/transtring
+Type: string
+_Default: 1
+_Description: Count of templates:
+ The number of useless numbers that a translator would have to translate
+ for this template.
+
+Template: debconf/language
+__Choices: English, Spanish, German, French
+# This is the default choice.  Translators should put their own language,
+# if available, here instead, but the value MUST be the English version
+# of the value for the package scripts to work properly.
+_Default: English[ translators, see the comment in the PO files]
+_Description: The default language, an example of a default that should
+ be translated.

Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf	2006-09-27 03:46:49 UTC (rev 754)
+++ trunk/testset/tags.debconf	2006-09-27 04:47:01 UTC (rev 755)
@@ -4,6 +4,7 @@
 E: debconf-test: extended-description-is-empty
 E: debconf-test: mismatch-translated-choices debconf/testmulti choices-de.utf-8
 E: debconf-test: no-template-description debconf/no-description
+E: debconf-test: no-template-type debconf/language
 E: debconf-test: settitle-requires-versioned-depends config
 E: debconf-test: unknown-debconf-priority config:11 LOW
 E: debconf-test: unknown-debconf-priority config:12 normal
@@ -13,6 +14,8 @@
 W: debconf source: maintainer-script-lacks-debhelper-token debian/debconf-test.postinst
 W: debconf source: newer-debconf-templates
 W: debconf source: stray-translated-debconf-templates debconf-test.templates.de
+W: debconf source: translated-default-field debconf-test.templates: 62
+W: debconf source: translated-default-field debconf-test.templates: 67
 W: debconf source: unknown-encoding-in-po-file debian/po/fr.po
 W: debconf-test-noscripts: no-debconf-config
 W: debconf-test-noscripts: old-fsf-address-in-copyright-file



Reply to: