summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-11-09 18:56:42 +0100
committerraveit65 <[email protected]>2020-11-11 15:50:20 +0100
commit40f061c638ae125fc6a4170807fa890362050e0f (patch)
treee89d6d7a2a5544cab45e62efaeba57f444b61229
parent02375fa336ce11c0cc5949691babc03d9bfb9023 (diff)
downloadcaja-40f061c638ae125fc6a4170807fa890362050e0f.tar.bz2
caja-40f061c638ae125fc6a4170807fa890362050e0f.tar.xz
Fix i18n in backgrounds and emblems dialog
-rw-r--r--eel/eel-xml-extensions.c40
-rw-r--r--eel/eel-xml-extensions.h2
-rw-r--r--libcaja-private/caja-customization-data.c4
-rw-r--r--src/caja-property-browser.c12
4 files changed, 8 insertions, 50 deletions
diff --git a/eel/eel-xml-extensions.c b/eel/eel-xml-extensions.c
index de09b99f..da2cf6b5 100644
--- a/eel/eel-xml-extensions.c
+++ b/eel/eel-xml-extensions.c
@@ -84,43 +84,3 @@ eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
property_name,
property_value);
}
-
-xmlChar *
-eel_xml_get_property_translated (xmlNodePtr parent,
- const char *property_name)
-{
- xmlChar *property, *untranslated_property;
- char *untranslated_property_name;
- const char *translated_property;
-
- /* Try for the already-translated version. */
- property = xmlGetProp (parent, property_name);
- if (property != NULL)
- {
- return property;
- }
-
- /* Try for the untranslated version. */
- untranslated_property_name = g_strconcat ("_", property_name, NULL);
- untranslated_property = xmlGetProp (parent, untranslated_property_name);
- g_free (untranslated_property_name);
- if (untranslated_property == NULL)
- {
- return NULL;
- }
-
- /* Try to translate. */
- translated_property = gettext (untranslated_property);
-
- /* If not translation is found, return untranslated property as-is. */
- if (translated_property == (char *) untranslated_property)
- {
- return untranslated_property;
- }
-
- /* If a translation happened, make a copy to match the normal
- * behavior of this function (returning a string you xmlFree).
- */
- xmlFree (untranslated_property);
- return xmlStrdup (translated_property);
-}
diff --git a/eel/eel-xml-extensions.h b/eel/eel-xml-extensions.h
index 90d19f5f..fba9ba57 100644
--- a/eel/eel-xml-extensions.h
+++ b/eel/eel-xml-extensions.h
@@ -37,7 +37,5 @@ xmlNodePtr eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
const char *child_name,
const char *property_name,
const char *property_value);
-xmlChar *eel_xml_get_property_translated (xmlNodePtr parent,
- const char *property_name);
#endif /* EEL_XML_EXTENSIONS_H */
diff --git a/libcaja-private/caja-customization-data.c b/libcaja-private/caja-customization-data.c
index ebd0b029..dded5f65 100644
--- a/libcaja-private/caja-customization-data.c
+++ b/libcaja-private/caja-customization-data.c
@@ -485,11 +485,11 @@ load_name_map_hash_table (CajaCustomizationData *data)
{
char *filename, *display_name;
- display_name = eel_xml_get_property_translated (current_node, "display_name");
+ display_name = xmlGetProp (current_node, "display_name");
filename = xmlGetProp (current_node, "filename");
if (display_name && filename)
{
- g_hash_table_replace (data->name_map_hash, g_strdup (filename), g_strdup (display_name));
+ g_hash_table_replace (data->name_map_hash, g_strdup (filename), g_strdup (_(display_name)));
}
xmlFree (filename);
xmlFree (display_name);
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index 957792f8..a12ca187 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -2071,13 +2071,13 @@ make_properties_from_xml_node (CajaPropertyBrowser *property_browser,
}
color = xmlNodeGetContent (child_node);
- name = eel_xml_get_property_translated (child_node, "name");
+ name = xmlGetProp (child_node, "name");
/* make the image from the color spec */
pixbuf = make_color_drag_image (property_browser, color, FALSE);
/* make the tile from the pixmap and name */
- new_property = labeled_image_new (name, pixbuf, color, PANGO_SCALE_LARGE);
+ new_property = labeled_image_new (_(name), pixbuf, color, PANGO_SCALE_LARGE);
gtk_container_add (GTK_CONTAINER (property_browser->details->content_table), new_property);
gtk_widget_show (new_property);
@@ -2266,14 +2266,14 @@ caja_property_browser_update_contents (CajaPropertyBrowser *property_browser)
{
path = xmlGetProp (cur_node, "path");
mode = xmlGetProp (cur_node, "mode");
- description = eel_xml_get_property_translated (cur_node, "description");
+ description = xmlGetProp (cur_node, "description");
type = xmlGetProp (cur_node, "type");
make_category (property_browser,
path,
mode,
cur_node,
- description);
+ _(description));
caja_property_browser_set_drag_type (property_browser, type);
xmlFree (path);
@@ -2284,12 +2284,12 @@ caja_property_browser_update_contents (CajaPropertyBrowser *property_browser)
if (!got_categories)
{
- display_name = eel_xml_get_property_translated (cur_node, "display_name");
+ display_name = xmlGetProp (cur_node, "display_name");
image = xmlGetProp (cur_node, "image");
make_category_link (property_browser,
name,
- display_name,
+ _(display_name),
image,
&group);