GNU gettext utilities: Icons

From Get docs
Gettext/docs/latest/Icons


16.2.3.1 How to handle icons in Desktop Entry files

Icons are generally locale dependent, for the following reasons:

  • Icons may contain signs that are considered rude in some cultures. For example, the high-five sign, in some cultures, is perceived as an unfriendly “stop” sign.
  • Icons may contain metaphors that are culture specific. For example, a mailbox in the U.S. looks different than mailboxes all around the world.
  • Icons may need to be mirrored for right-to-left locales.
  • Icons may contain text strings (a bad practice, but anyway).

However, icons are not covered by GNU gettext localization, because

  • Icons cannot be easily embedded in PO files,
  • The need to localize an icon is rare, and the ability to do so in a PO file would introduce translator mistakes.

Desktop Entry files may contain an ‘Icon’ property, and this property is localizable. If a translator wishes to localize an icon, she should do so by bypassing the normal workflow with PO files:

  1. The translator contacts the package developers directly, sending them the icon appropriate for her locale, with a request to change the template file.
  2. The package developers add the icon file to their repository, and a line

    Icon[locale]=icon_file_name

    to the template file.

This line remains in place when this template file is merged with the translators’ PO files, through msgfmt.