Reclassify Icon= in .desktop files as string, not localestring
Florian Müllner
fmuellner at gnome.org
Tue Jun 25 14:46:28 UTC 2019
On Tue, Jun 25, 2019 at 2:27 PM Egmont Koblinger <egmont at gmail.com> wrote:
>
> Hi,
>
> > Currently, Icon= and similar fields in .desktop files are defined to be "localestring", and are extracted for translation by tools like xgettext.
>
> Are they really automatically extracted? Could you please point to a
> concrete project(s) where this is an issue?
>
> In the one I've tested (gnome-terminal), only keywords with
> underscores are extracted. That is, if you have "_Icon=..." in the
> .desktop.in file then its value gets extracted to the .pot file, and
> you end up with translated strings in .desktop. However, if you simply
> have "Icon=..." in the .desktop.in file then it remains as-is in the
> generated .desktop, and isn't extracted to the .pot file either. That
> is, as far as I can see, there's no problem and there's nothing to
> fix. What am I missing?
Extracting translatable strings from .desktop files using '_' prefixes
is what intltool does. However as gettext itself supports extracting
strings from .desktop files nowadays, using intltool is discouraged
nowadays (at least in GNOME):
https://wiki.gnome.org/MigratingFromIntltoolToGettext
Gettext's .desktop file support doesn't depend on explicit markers
though, it extracts all strings it knows can be localized (including
the Icon= field).
So any project that uses upstream gettext instead of intltool is
affected by this. That includes any project that has moved to the
meson build system (as meson doesn't have any intltool integration).
More information about the xdg
mailing list