[dia: 1/2] change: improve interface translation



commit 62948d6206a17b4c32844ff15ee5d2371b998c41
Author: Ivan Razzhivin <underwit altlinux org>
Date:   Wed Jan 30 15:25:20 2019 +0300

    change: improve interface translation
    
    modified:
    app/disp_callbacks.c - translate the shape name for the context menu
    app/display.c - translate the shape name for the status bar
    app/menus.c - translate the name of the tooltips for the menu
    app/properties-dialog.c - translate the shape name for the title
    lib/prop_text.c - fix empty object display name
    plug-ins/pixbuf/pixbuf.c - fix problem with gettext
    plug-ins/shape/shape.c - translate plugin description

 app/disp_callbacks.c     | 2 +-
 app/display.c            | 2 +-
 app/menus.c              | 2 +-
 app/properties-dialog.c  | 2 +-
 lib/prop_text.c          | 2 +-
 plug-ins/pixbuf/pixbuf.c | 2 +-
 plug-ins/shape/shape.c   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 82555660..030dd2e6 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -266,7 +266,7 @@ add_combine_to_path_menu_items (GtkMenu *menu)
   };
   int i;
   for (i = 0; i < G_N_ELEMENTS (_ops); ++i) {
-    GtkWidget *menu_item = gtk_menu_item_new_with_label(_ops[i].name);
+    GtkWidget *menu_item = gtk_menu_item_new_with_label(_(_ops[i].name));
     g_signal_connect(G_OBJECT(menu_item), "activate",
                     G_CALLBACK(_combine_to_path_callback), GINT_TO_POINTER (_ops[i].mode));
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
diff --git a/app/display.c b/app/display.c
index 076d0468..a6210880 100644
--- a/app/display.c
+++ b/app/display.c
@@ -116,7 +116,7 @@ selection_changed (Diagram* dia, int n, DDisplay* ddisp)
     /* find the selected objects name - and display it */
     DiaObject *object = (DiaObject *)ddisp->diagram->data->selected->data;
     gchar *name = object_get_displayname (object);
-    gchar *msg = g_strdup_printf (_("Selected '%s'"), name);
+    gchar *msg = g_strdup_printf (_("Selected '%s'"), _(name));
 
     gtk_statusbar_pop (statusbar, context_id);
     gtk_statusbar_push (statusbar, context_id, msg);
diff --git a/app/menus.c b/app/menus.c
index d339e839..53f4fc33 100644
--- a/app/menus.c
+++ b/app/menus.c
@@ -696,7 +696,7 @@ create_or_ref_tool_actions (void)
                        G_CALLBACK (tool_menu_select),
                        &tool_data[i].callback_data);
 
-      gtk_action_set_tooltip (action, tool_data[i].tool_desc);
+      gtk_action_set_tooltip (action, _(tool_data[i].tool_desc));
 
       {
         GdkPixbuf *pb = tool_get_pixbuf (&tool_data[i]);
diff --git a/app/properties-dialog.c b/app/properties-dialog.c
index 16e086b3..265a38ce 100644
--- a/app/properties-dialog.c
+++ b/app/properties-dialog.c
@@ -245,7 +245,7 @@ object_list_properties_show(Diagram *dia, GList *objects)
     DiaObjectType *otype = one_obj->type;
     gchar *buf;
     
-    buf = g_strconcat(_("Properties: "), otype->name, NULL);
+    buf = g_strconcat(_("Properties: "), _(otype->name), NULL);
     gtk_window_set_title(GTK_WINDOW(dialog), buf);
     g_free(buf);
   } else {
diff --git a/lib/prop_text.c b/lib/prop_text.c
index a6e6d132..5a4ff904 100644
--- a/lib/prop_text.c
+++ b/lib/prop_text.c
@@ -488,7 +488,7 @@ object_get_displayname (DiaObject* object)
   else if ((prop = object_prop_by_name(object, "text")) != NULL)
     name = g_strdup (((TextProperty *)prop)->text_data);
 
-  if (!name)
+  if (!name || (0 == strcmp(name, "")))
     name = g_strdup (object->type->name);
 
   if (prop)
diff --git a/plug-ins/pixbuf/pixbuf.c b/plug-ins/pixbuf/pixbuf.c
index 9eb26ed0..5c0b3f32 100644
--- a/plug-ins/pixbuf/pixbuf.c
+++ b/plug-ins/pixbuf/pixbuf.c
@@ -25,13 +25,13 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
-#include "intl.h"
 #include "geometry.h"
 #include "diagdkrenderer.h"
 #include "filter.h"
 #include "plug-ins.h"
 #include "properties.h"
 #include "object.h"
+#include "intl.h"
 
 static gboolean
 export_data(DiagramData *data, DiaContext *ctx,
diff --git a/plug-ins/shape/shape.c b/plug-ins/shape/shape.c
index 1ccb963e..d92d8436 100644
--- a/plug-ins/shape/shape.c
+++ b/plug-ins/shape/shape.c
@@ -33,7 +33,7 @@ PluginInitResult
 dia_plugin_init(PluginInfo *info)
 {
   if (!dia_plugin_info_init(info, "shape",
-                           N_("Dia shape export filter"),
+                           _("Dia shape export filter"),
                            NULL, NULL))
     return DIA_PLUGIN_INIT_ERROR;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]