Index: mate-menus-1.22.0/libmenu/desktop-entries.c =================================================================== --- mate-menus-1.22.0/libmenu/desktop-entries.c +++ mate-menus-1.22.0/libmenu/desktop-entries.c 2019-03-11 20:16:39.784062146 +0100 @@ -23,6 +23,7 @@ #include <gio/gdesktopappinfo.h> #include <string.h> +#include <libintl.h> #include "menu-util.h" @@ -249,6 +250,27 @@ return TRUE; } + +static char * +get_locale_string (GKeyFile *key_file, const char *desktop_entry_group, const char * key) +{ + char *result, *non_translated; + static gboolean l10n_init = FALSE; + + result = g_key_file_get_locale_string (key_file, desktop_entry_group, key, NULL, NULL); + non_translated = g_key_file_get_string (key_file, desktop_entry_group, key, NULL); + if (non_translated && result && *non_translated != '\0' && strcmp (result, non_translated) == 0) { + g_free (result); + if (!l10n_init) { + bind_textdomain_codeset ("menu-messages", "UTF-8"); + } + result = g_strdup (dgettext ("menu-messages", non_translated)); + } + g_free (non_translated); + + return result; +} + static gboolean desktop_entry_load (DesktopEntry *entry) {