Comment 5 for bug 533565

Revision history for this message
David Planella (dpm) wrote : Re: [Bug 533565] Re: Strings missing from the template

El dj 11 de 03 de 2010 a les 10:52 +0000, en/na Gabor Kelemen va
escriure:
> Okay, I found it :)
>
> The problem is that the files do not have a .py extension, thus xgettext
> tries to parse them as C files. This would not be a problem (update-
> manager has ), if strings were enclosed between " marks, but they are
> between ' marks, which is valid for python, but not for C.
>

Generally, this would be a problem for extensionless scripts using
intltool (see bug 377872), but apport uses python-distutils-extra, which
IIRC works around this by creating temporary symlinks to .py files
before calling intltool, only to delete them afterwards. You can also
see this in all p-d-e created templates, where the source code
references sometimes refer to 'somescript.py', where there is actually
only an extensionless 'somescript'.

> So, we can either:
>
> -rename the files to apport-{gtk|kde}.py
> -or put the strings between " marks.
>
> Also, it is worth noting that intltool-update -m does not detect these
> files, probably because of the lacking .py extension, so I think we will
> need to use POTFILES.in, if we decide to not use .py extensions.
>

Unfortunately having a POTFILES.in file would not help here, either,
since currently intltool only detects by extension or [type: ]
specifier. For builtin types, such as python, there is no way to specify
the type e.g. [type: gettext/python], so they are generally parsed by
xgettext as C files.

I think the issue here might be to find out why python-distutils-extra
does not detect the apport-{gtk|kde} files as python scripts.

The ' vs " is an interesting point, though.