aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-02-12 02:07:39 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-02-12 18:40:16 +0100
commit9a217e97c8852bda5a7fdf1cad41da769f013fef (patch)
treef6dd0ae78fccb0333ebef238dfea04311d487266 /src
parent68e6e4a7e8e5a217f6288e23ec50290835988f37 (diff)
downloadlogdiag-9a217e97c8852bda5a7fdf1cad41da769f013fef.tar.gz
logdiag-9a217e97c8852bda5a7fdf1cad41da769f013fef.tar.xz
logdiag-9a217e97c8852bda5a7fdf1cad41da769f013fef.zip
Change the way translations are done.
* Require gettext-tools to build. * Depend on libintl on Win32.
Diffstat (limited to 'src')
-rw-r--r--src/ld-window-main.c72
-rw-r--r--src/logdiag.c3
2 files changed, 38 insertions, 37 deletions
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 0c671ed..463f2ef 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -110,61 +110,61 @@ static void on_action_normal_size (GtkAction *action, LdWindowMain *self);
/* Actions for menus, toolbars, accelerators. */
static GtkActionEntry wm_action_entries[] =
{
- {"FileMenu", NULL, Q_("_File"), NULL, NULL, NULL},
- {"New", GTK_STOCK_NEW, Q_("_New"), "<Ctrl>N",
- Q_("Create a new diagram"),
+ {"FileMenu", NULL, N_("_File"), NULL, NULL, NULL},
+ {"New", GTK_STOCK_NEW, N_("_New"), "<Ctrl>N",
+ N_("Create a new diagram"),
G_CALLBACK (on_action_new)},
- {"Open", GTK_STOCK_OPEN, Q_("_Open..."), "<Ctrl>O",
- Q_("Open a diagram"),
+ {"Open", GTK_STOCK_OPEN, N_("_Open..."), "<Ctrl>O",
+ N_("Open a diagram"),
G_CALLBACK (on_action_open)},
- {"Save", GTK_STOCK_SAVE, Q_("_Save"), "<Ctrl>S",
- Q_("Save the current diagram"),
+ {"Save", GTK_STOCK_SAVE, N_("_Save"), "<Ctrl>S",
+ N_("Save the current diagram"),
G_CALLBACK (on_action_save)},
- {"SaveAs", GTK_STOCK_SAVE_AS, Q_("Save _As..."), "<Shift><Ctrl>S",
- Q_("Save the current diagram with another name"),
+ {"SaveAs", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<Shift><Ctrl>S",
+ N_("Save the current diagram with another name"),
G_CALLBACK (on_action_save_as)},
/*
- * {"Export", NULL, Q_("_Export"), NULL,
- * Q_("Export the diagram"),
+ * {"Export", NULL, N_("_Export"), NULL,
+ * N_("Export the diagram"),
* NULL},
*/
- {"Quit", GTK_STOCK_QUIT, Q_("_Quit"), "<Ctrl>Q",
- Q_("Quit the application"),
+ {"Quit", GTK_STOCK_QUIT, N_("_Quit"), "<Ctrl>Q",
+ N_("Quit the application"),
G_CALLBACK (on_action_quit)},
- {"EditMenu", NULL, Q_("_Edit"), NULL, NULL, NULL},
- {"Undo", GTK_STOCK_UNDO, Q_("_Undo"), "<Ctrl>Z",
- Q_("Undo the last action"),
+ {"EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL},
+ {"Undo", GTK_STOCK_UNDO, N_("_Undo"), "<Ctrl>Z",
+ N_("Undo the last action"),
G_CALLBACK (on_action_undo)},
- {"Redo", GTK_STOCK_REDO, Q_("_Redo"), "<Shift><Ctrl>Z",
- Q_("Redo the last undone action"),
+ {"Redo", GTK_STOCK_REDO, N_("_Redo"), "<Shift><Ctrl>Z",
+ N_("Redo the last undone action"),
G_CALLBACK (on_action_redo)},
/*
- * {"Cut", GTK_STOCK_CUT, Q_("Cu_t"), "<Ctrl>X", NULL, NULL},
- * {"Copy", GTK_STOCK_COPY, Q_("_Copy"), "<Ctrl>C", NULL, NULL},
- * {"Paste", GTK_STOCK_PASTE, Q_("_Paste"), "<Ctrl>V", NULL, NULL},
+ * {"Cut", GTK_STOCK_CUT, N_("Cu_t"), "<Ctrl>X", NULL, NULL},
+ * {"Copy", GTK_STOCK_COPY, N_("_Copy"), "<Ctrl>C", NULL, NULL},
+ * {"Paste", GTK_STOCK_PASTE, N_("_Paste"), "<Ctrl>V", NULL, NULL},
*/
- {"Delete", GTK_STOCK_DELETE, Q_("_Delete"), "Delete",
- Q_("Delete the contents of the selection"),
+ {"Delete", GTK_STOCK_DELETE, N_("_Delete"), "Delete",
+ N_("Delete the contents of the selection"),
G_CALLBACK (on_action_delete)},
- {"SelectAll", GTK_STOCK_SELECT_ALL, Q_("Select _All"), "<Ctrl>A",
- Q_("Select all objects in the diagram"),
+ {"SelectAll", GTK_STOCK_SELECT_ALL, N_("Select _All"), "<Ctrl>A",
+ N_("Select all objects in the diagram"),
G_CALLBACK (on_action_select_all)},
- {"ViewMenu", NULL, Q_("_View"), NULL, NULL, NULL},
- {"ZoomIn", GTK_STOCK_ZOOM_IN, Q_("_Zoom In"), "<Ctrl>plus",
- Q_("Zoom into the diagram"),
+ {"ViewMenu", NULL, N_("_View"), NULL, NULL, NULL},
+ {"ZoomIn", GTK_STOCK_ZOOM_IN, N_("_Zoom In"), "<Ctrl>plus",
+ N_("Zoom into the diagram"),
G_CALLBACK (on_action_zoom_in)},
- {"ZoomOut", GTK_STOCK_ZOOM_OUT, Q_("Zoom _Out"), "<Ctrl>minus",
- Q_("Zoom out of the diagram"),
+ {"ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<Ctrl>minus",
+ N_("Zoom out of the diagram"),
G_CALLBACK (on_action_zoom_out)},
- {"NormalSize", GTK_STOCK_ZOOM_100, Q_("_Normal Size"), "<Ctrl>0",
- Q_("Reset zoom level back to the default"),
+ {"NormalSize", GTK_STOCK_ZOOM_100, N_("_Normal Size"), "<Ctrl>0",
+ N_("Reset zoom level back to the default"),
G_CALLBACK (on_action_normal_size)},
- {"HelpMenu", NULL, Q_("_Help"), NULL, NULL, NULL},
- {"About", GTK_STOCK_ABOUT, Q_("_About"), NULL,
- Q_("Show a dialog about this application"),
+ {"HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL},
+ {"About", GTK_STOCK_ABOUT, N_("_About"), NULL,
+ N_("Show a dialog about this application"),
G_CALLBACK (on_action_about)}
};
@@ -216,6 +216,8 @@ ld_window_main_init (LdWindowMain *self)
G_CALLBACK (on_ui_proxy_disconnected), self);
priv->action_group = gtk_action_group_new ("MainActions");
+ gtk_action_group_set_translation_domain
+ (priv->action_group, GETTEXT_DOMAIN);
gtk_action_group_add_actions (priv->action_group, wm_action_entries,
G_N_ELEMENTS (wm_action_entries), self);
gtk_ui_manager_insert_action_group (priv->ui_manager,
diff --git a/src/logdiag.c b/src/logdiag.c
index 20783b1..8191d7f 100644
--- a/src/logdiag.c
+++ b/src/logdiag.c
@@ -9,6 +9,7 @@
*/
#include <gtk/gtk.h>
+#include <locale.h>
#include "config.h"
@@ -20,13 +21,11 @@ main (int argc, char *argv[])
{
GtkWidget *wnd;
-#ifdef HAVE_GETTEXT
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_DOMAIN, GETTEXT_DIRNAME);
bind_textdomain_codeset (GETTEXT_DOMAIN, "UTF-8");
textdomain (GETTEXT_DOMAIN);
-#endif
/* For custom command line arguments, see:
* http://git.gnome.org/browse/glade3/tree/src/main.c