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

Re: Another raw idea for lintian check: variable substitution in debconf templates



On Sat, 09 Feb 2008 09:27:51 -0800
Russ Allbery <rra@debian.org> wrote:

> I assume that something like the following pseudocode would work:
> 
>     foreach pofile in debian/po/*.po
>         foreach msgid, msgstr in pofile
>             vars_needed = find_variables(msgid)
>             vars_found  = find_variables(msgstr)
>             if (not empty(msgstr) and vars_needed != vars_found)
>                 tag 'variable-mismatch-in-translation', pofile, line
>             end
>         end
>     end

Yes, but you need the function "find_variables(string)" to return a sorted
list of variables. Otherwise your comparison later on could result in a
false positive, because the translator might have changed the position of
the variables for their grammar.

Regards,
Tobias

Attachment: signature.asc
Description: PGP signature


Reply to: