From b49f703b6a3f61fc20de310b0343dd2f6661fbed Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 19 Sep 2019 18:06:59 +0200 Subject: caja-extensions: allows the translation of copyright --- libcaja-private/caja-extensions.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-extensions.c b/libcaja-private/caja-extensions.c index 9b34fdcd..b1a1bbe5 100644 --- a/libcaja-private/caja-extensions.c +++ b/libcaja-private/caja-extensions.c @@ -25,6 +25,7 @@ #include "caja-global-preferences.h" #include "caja-module.h" +#include "caja-debug-log.h" #include @@ -36,6 +37,7 @@ static GList *caja_extensions = NULL; static Extension * extension_new (gchar *filename, gboolean state, gboolean python, GObject *module) { + GError *error = NULL; Extension *ext; GKeyFile *extension_file; gchar *extension_filename; @@ -53,17 +55,22 @@ extension_new (gchar *filename, gboolean state, gboolean python, GObject *module extension_file = g_key_file_new (); extension_filename = g_strdup_printf(CAJA_DATADIR "/extensions/%s.caja-extension", filename); - if (g_key_file_load_from_file (extension_file, extension_filename, G_KEY_FILE_NONE, NULL)) + if (g_key_file_load_from_file (extension_file, extension_filename, G_KEY_FILE_NONE, &error)) { ext->name = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Name", NULL, NULL); ext->description = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Description", NULL, NULL); ext->icon = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Icon", NULL); ext->author = g_key_file_get_string_list (extension_file, CAJA_EXTENSION_GROUP, "Author", NULL, NULL); - ext->copyright = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Copyright", NULL); + ext->copyright = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Copyright", NULL, NULL); ext->version = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Version", NULL); ext->website = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Website", NULL); + g_key_file_free (extension_file); + } + else + { + caja_debug_log (FALSE, CAJA_DEBUG_LOG_DOMAIN_USER, "Error loading keys from file: %s\n", error->message); + g_error_free (error); } - g_key_file_free (extension_file); g_free (extension_filename); if (python) -- cgit v1.2.1