On Mon, 19 Jan 2009 12:20:40 -0800 Russ Allbery <r...@debian.org> wrote:
> If I check the generated templates in the binary deb, how do I check that > the string was marked for translation? We don't want to trigger this tag > on strings that aren't intended to be translated. TBH I was expecting that all questions would be translated - at least the help text (Description), even if not the possible answers. Otherwise, doesn't it tend to indicate that debconf is being used as a registry? The empirical answer, at the moment, would be as described earlier: Template: ... Description: .... Template: should fail - with the proviso that the last question in the file also needs to be allowed to fail, so check for EOF as well. Template: ... Description: .... Description- ... Template: would pass. A quick check finds these files on my system that contain unexpected content like: Template: debconf-apt-progress/info Type: text Description: ${DESCRIPTION} Template: debconf-apt-progress/media-change Type: text Description: Media change ${MESSAGE} How are those variables utilised? Where and how could these be translated? debconf.templates failed console-data.templates failed x11-common.templates failed gdm.templates failed console-setup.templates failed tasksel.templates failed dbconfig-common.templates failed linux-image-2.6.24-1-amd64.templates failed linux-image-2.6.25-2-amd64.templates failed linux-image-2.6.26-1-amd64.templates failed That's using a script based on the perl script from the other message. Out of 65 templates on this system, it's a start. Choices is a little awkward but I cannot see a scenario where Choices is *translated* but the Description *is not* so basing the check on Description alone (to avoid a more common case where Choices is not translatable) is appropriate, AFAICT. x11 has: Template: x11-common/xwrapper/actual_allowed_users Type: string Description: internal use only This template is never shown to the user and does not require translation. Others include: Template: console-data/bootmap-md5sum Type: string Default: none Description: for internal use Template: gdm/daemon_name Type: string Default: /usr/bin/gdm Description: for internal use only Template: console-setup/modelcode Type: string Description: for internal use Template: console-setup/layoutcode Type: string Description: for internal use Template: console-setup/variantcode Type: string Description: for internal use Template: console-setup/optionscode Type: string Description: for internal use Template: console-setup/fontsize Type: string Description: for internal use Template: console-setup/codesetcode Type: string Description: for internal use Those all look wrong to me - debconf for internal use only? Template: tasksel/desktop Type: multiselect Choices: gnome, kde, xfce Default: gnome Description: The desktop environment to install when the desktop task is selected This can be preseeded to change the default. (That tasksel one looks like a true positive - I can't see why that is not translated.) Template: dbconfig-common/missing-db-package-error Type: select Choices: abort, retry, ignore Default: abort Description: Database package required. To properly configure the database for ${pkg}, it is necessary that you also have ${dbpackage} installed. Unfortunately, this can not be done automatically. . If in doubt, you should choose "abort", and install ${dbpackage} before continuing with the configuration of this package. If you choose "retry", you will be allowed to choose different answers (in case you chose the wrong database type by mistake). If you choose "ignore", then installation will continue as normal. . (Note to translators: don't bother translating this message yet, as the text/wording is not stabilized) Hmm. That's going to be tricky to identify but probably OK for an override. linux-image-2.6.24-1-amd64.templates - none of the strings appear to be translated and to my eye, all should have been - true positive? Ditto for linux-image-2.6.25-2-amd64.templates and linux-image-2.6.26-1-amd64.templates I'm attaching the script so that others can check their templates files. (Consider it under the GPL-3+, Copyright me 2009. Note that it does not currently check for EOF correctly.) So, overall, only one package needs an override from this cursory glance at one machine, two packages (four template files) look like correct checks that should have been caught before (probably) and another 4 that are using debconf "for internal use" which seems to be against the spirit of debconf, to me anyway. Oh and before anyone asks, I'm not saying that the true positive checks or the "internal use only" templates need to be fixed for Lenny. ;-) -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
#!/usr/bin/perl opendir (LINT, "/var/lib/dpkg/info/"); @files=grep(/templates$/, readdir(LINT)); closedir (LINT); foreach $file (@files) { open (FILE, "/var/lib/dpkg/info/$file"); @lines=<FILE>; close (FILE); my $incomplete; my $stanza; foreach $line (@lines) { if ($line =~ /^Description: /) { $stanza++; undef $incomplete; next; } undef ($stanza) if ($line =~ /^Description-/); if ((defined ($stanza) and ($line =~ /^Template:/))) { $incomplete++; last; } } close (I18N); print "$file failed\n" if (defined $incomplete); }
pgpwz0R2EegMf.pgp
Description: PGP signature