From f939df14afd1474d5d0c05d5552fee3af2d481e8 Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Mon, 25 Nov 2019 16:32:46 +0800 Subject: Taglist: Load the local translation string from lang.mo file When using intltool, the taglist creates a big xml file containing the local translation string, so that it has to be compressed. It looks like this: ``` ... ... ... ... ... ... ``` Obviously, it wastes space and download bandwidth. When switch from intltool to gettext, it does not generate a similar huge xml file. It only get the translate string into pot file from the xml file, and the original xml file has not changed. This patch let taglist-plugin read the local translation string directly from the mo file, so that it can work as before. TODO: we need to improve and optimize the taglist plugin code and drop some extra code. --- plugins/taglist/pluma-taglist-plugin-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/taglist/pluma-taglist-plugin-parser.c b/plugins/taglist/pluma-taglist-plugin-parser.c index 6f18dbc5..10e9e9ca 100644 --- a/plugins/taglist/pluma-taglist-plugin-parser.c +++ b/plugins/taglist/pluma-taglist-plugin-parser.c @@ -139,7 +139,7 @@ parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, tag = g_new0 (Tag, 1); /* Get Tag name */ - tag->name = xmlGetProp (cur, (const xmlChar *) "name"); + tag->name = (xmlChar*)gettext((const char*)xmlGetProp (cur, (const xmlChar *) "name")); if (tag->name == NULL) { @@ -195,7 +195,7 @@ get_tag_group (const gchar* filename, xmlDocPtr doc, tag_group = g_new0 (TagGroup, 1); /* Get TagGroup name */ - tag_group->name = xmlGetProp (cur, (const xmlChar *) "name"); + tag_group->name = (xmlChar*)gettext((const char*)xmlGetProp (cur, (const xmlChar *) "name")); sort_str = xmlGetProp (cur, (const xmlChar *) "sort"); -- cgit v1.2.1