Commit 2a2e96798031245c0a798911feb3c62c079a473b
1 parent
1108431d
Exists in
master
and in
1 other branch
Updating/fixing translations.
Showing
12 changed files
with
123 additions
and
74 deletions
Show diff stats
src/dialogs/print/convenience.c
@@ -146,7 +146,7 @@ | @@ -146,7 +146,7 @@ | ||
146 | 146 | ||
147 | int v3270_print(GtkWidget *widget, GError **error) | 147 | int v3270_print(GtkWidget *widget, GError **error) |
148 | { | 148 | { |
149 | - return v3270_print_dialog(widget,(lib3270_has_selection(GTK_V3270(widget)->host) ? LIB3270_CONTENT_SELECTED : LIB3270_CONTENT_ALL),error); | 149 | + return v3270_print_dialog(widget,(lib3270_get_has_selection(GTK_V3270(widget)->host) ? LIB3270_CONTENT_SELECTED : LIB3270_CONTENT_ALL),error); |
150 | } | 150 | } |
151 | 151 | ||
152 | 152 |
src/dialogs/settings/accelerator.c
@@ -95,7 +95,8 @@ | @@ -95,7 +95,8 @@ | ||
95 | enum | 95 | enum |
96 | { | 96 | { |
97 | ACTION, ///< @brief The action object. | 97 | ACTION, ///< @brief The action object. |
98 | - DESCRIPTION, ///< @brief The action description. | 98 | + NAME, ///< @brief The action name. |
99 | + SUMMARY, ///< @brief The action summary. | ||
99 | MAIN_MASK, ///< @brief The mask for the main accelerator. | 100 | MAIN_MASK, ///< @brief The mask for the main accelerator. |
100 | MAIN_VALUE, ///< @brief The value for the main accelerator. | 101 | MAIN_VALUE, ///< @brief The value for the main accelerator. |
101 | ALTERNATIVE_MASK, ///< @brief The mask for the alternative accelerator. | 102 | ALTERNATIVE_MASK, ///< @brief The mask for the alternative accelerator. |
@@ -116,16 +117,6 @@ | @@ -116,16 +117,6 @@ | ||
116 | // Create description list | 117 | // Create description list |
117 | GtkCellRenderer * text_renderer = gtk_cell_renderer_text_new(); | 118 | GtkCellRenderer * text_renderer = gtk_cell_renderer_text_new(); |
118 | 119 | ||
119 | - /* | ||
120 | - g_object_set( | ||
121 | - text_renderer, | ||
122 | - "alignment", PANGO_ALIGN_LEFT, | ||
123 | - "wrap-width", 100, | ||
124 | - "wrap-mode", PANGO_WRAP_WORD_CHAR, | ||
125 | - NULL | ||
126 | - ); | ||
127 | - */ | ||
128 | - | ||
129 | // Create accelerator render | 120 | // Create accelerator render |
130 | GtkCellRenderer * accel_renderer[] = { gtk_cell_renderer_accel_new(), gtk_cell_renderer_accel_new() }; | 121 | GtkCellRenderer * accel_renderer[] = { gtk_cell_renderer_accel_new(), gtk_cell_renderer_accel_new() }; |
131 | 122 | ||
@@ -144,32 +135,43 @@ | @@ -144,32 +135,43 @@ | ||
144 | g_signal_connect (G_OBJECT(accel_renderer[0]), "accel_edited", G_CALLBACK (accel_edited), widget); | 135 | g_signal_connect (G_OBJECT(accel_renderer[0]), "accel_edited", G_CALLBACK (accel_edited), widget); |
145 | g_signal_connect (G_OBJECT(accel_renderer[1]), "accel_edited", G_CALLBACK (alternative_edited), widget); | 136 | g_signal_connect (G_OBJECT(accel_renderer[1]), "accel_edited", G_CALLBACK (alternative_edited), widget); |
146 | 137 | ||
147 | - widget->store = GTK_LIST_STORE(gtk_list_store_new(COLUMNS, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INT, G_TYPE_UINT)); | 138 | + widget->store = GTK_LIST_STORE(gtk_list_store_new(COLUMNS, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INT, G_TYPE_UINT)); |
148 | 139 | ||
149 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(widget->store),1,GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID); | 140 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(widget->store),1,GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID); |
150 | 141 | ||
151 | GtkWidget * view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(widget->store)); | 142 | GtkWidget * view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(widget->store)); |
152 | g_signal_connect(G_OBJECT(widget),"realize",G_CALLBACK(realize),view); | 143 | g_signal_connect(G_OBJECT(widget),"realize",G_CALLBACK(realize),view); |
153 | 144 | ||
154 | - /* | ||
155 | - g_object_set( | ||
156 | - view, | ||
157 | - "horizontal-separator", 50, | ||
158 | - "vertical-separator", 50, | ||
159 | - NULL | ||
160 | - ); | ||
161 | - */ | ||
162 | - | ||
163 | gtk_widget_set_tooltip_markup(view,_("Keyboard accelerators")); | 145 | gtk_widget_set_tooltip_markup(view,_("Keyboard accelerators")); |
164 | gtk_tree_view_set_fixed_height_mode(GTK_TREE_VIEW(view),FALSE); | 146 | gtk_tree_view_set_fixed_height_mode(GTK_TREE_VIEW(view),FALSE); |
165 | 147 | ||
166 | - // Description column | ||
167 | - GtkTreeViewColumn * column = | 148 | + GtkTreeViewColumn * column; |
149 | + | ||
150 | + // Name columns | ||
151 | + column = | ||
152 | + gtk_tree_view_column_new_with_attributes( | ||
153 | + _("Name"), | ||
154 | + text_renderer, | ||
155 | + "text", | ||
156 | + NAME, | ||
157 | + NULL | ||
158 | + ); | ||
159 | + | ||
160 | + gtk_tree_view_column_set_resizable(column, TRUE); | ||
161 | + | ||
162 | + gtk_tree_view_insert_column( | ||
163 | + GTK_TREE_VIEW(view), | ||
164 | + column, | ||
165 | + -1 | ||
166 | + ); | ||
167 | + | ||
168 | + // Summary column | ||
169 | + column = | ||
168 | gtk_tree_view_column_new_with_attributes( | 170 | gtk_tree_view_column_new_with_attributes( |
169 | - _("Action"), | 171 | + _("Summary"), |
170 | text_renderer, | 172 | text_renderer, |
171 | "text", | 173 | "text", |
172 | - DESCRIPTION, | 174 | + SUMMARY, |
173 | NULL | 175 | NULL |
174 | ); | 176 | ); |
175 | 177 | ||
@@ -205,7 +207,7 @@ | @@ -205,7 +207,7 @@ | ||
205 | 207 | ||
206 | for(ix = 1; ix < 3; ix++) | 208 | for(ix = 1; ix < 3; ix++) |
207 | { | 209 | { |
208 | - GtkTreeViewColumn * column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), ix); | 210 | + column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), ix); |
209 | gtk_tree_view_column_set_min_width(column, 200); | 211 | gtk_tree_view_column_set_min_width(column, 200); |
210 | gtk_tree_view_column_set_resizable(column, TRUE); | 212 | gtk_tree_view_column_set_resizable(column, TRUE); |
211 | } | 213 | } |
@@ -237,8 +239,6 @@ LIB3270_EXPORT GtkWidget * v3270_accelerator_settings_new() | @@ -237,8 +239,6 @@ LIB3270_EXPORT GtkWidget * v3270_accelerator_settings_new() | ||
237 | settings->title = _("Keyboard accelerators"); | 239 | settings->title = _("Keyboard accelerators"); |
238 | settings->label = _("Accelerators"); | 240 | settings->label = _("Accelerators"); |
239 | 241 | ||
240 | - debug("*********** [%s] [%s] [%s]",settings->title,gettext(settings->title),g_dgettext(GETTEXT_PACKAGE,settings->title)); | ||
241 | - | ||
242 | return GTK_WIDGET(settings); | 242 | return GTK_WIDGET(settings); |
243 | } | 243 | } |
244 | 244 | ||
@@ -510,7 +510,8 @@ void load(GtkWidget *widget, GtkWidget *terminal) | @@ -510,7 +510,8 @@ void load(GtkWidget *widget, GtkWidget *terminal) | ||
510 | store, | 510 | store, |
511 | &iter, | 511 | &iter, |
512 | ACTION, current, | 512 | ACTION, current, |
513 | - DESCRIPTION, v3270_accelerator_get_description(current), | 513 | + NAME, v3270_accelerator_get_name(current), |
514 | + SUMMARY, v3270_accelerator_get_summary(current), | ||
514 | MAIN_MASK, keymaps[0].mods, | 515 | MAIN_MASK, keymaps[0].mods, |
515 | MAIN_VALUE, keymaps[0].key, | 516 | MAIN_VALUE, keymaps[0].key, |
516 | ALTERNATIVE_MASK, keymaps[1].mods, | 517 | ALTERNATIVE_MASK, keymaps[1].mods, |
src/dialogs/settings/host.c
@@ -517,12 +517,12 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) | @@ -517,12 +517,12 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) | ||
517 | 517 | ||
518 | if(descriptor) | 518 | if(descriptor) |
519 | { | 519 | { |
520 | - widget->input.toggles[toggle] = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(gettext(descriptor->label))); | 520 | + widget->input.toggles[toggle] = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label(lib3270_toggle_get_label(descriptor))); |
521 | 521 | ||
522 | - if(descriptor->description && *descriptor->description) | ||
523 | - gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.toggles[toggle]),gettext(descriptor->description)); | ||
524 | - else if(descriptor->summary && *descriptor->summary) | ||
525 | - gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.toggles[toggle]),gettext(descriptor->summary)); | 522 | + const gchar *tooltip = lib3270_property_get_tooltip((const LIB3270_PROPERTY *) descriptor); |
523 | + | ||
524 | + if(tooltip && *tooltip) | ||
525 | + gtk_widget_set_tooltip_text(GTK_WIDGET(widget->input.toggles[toggle]),tooltip); | ||
526 | 526 | ||
527 | gtk_widget_set_halign(GTK_WIDGET(widget->input.toggles[toggle]),GTK_ALIGN_START); | 527 | gtk_widget_set_halign(GTK_WIDGET(widget->input.toggles[toggle]),GTK_ALIGN_START); |
528 | gtk_grid_attach(GTK_GRID(connection),GTK_WIDGET(widget->input.toggles[toggle]),toggleList[toggle].left,toggleList[toggle].top,1,1); | 528 | gtk_grid_attach(GTK_GRID(connection),GTK_WIDGET(widget->input.toggles[toggle]),toggleList[toggle].left,toggleList[toggle].top,1,1); |
src/dialogs/togglebutton.c
@@ -30,6 +30,7 @@ | @@ -30,6 +30,7 @@ | ||
30 | #include <internals.h> | 30 | #include <internals.h> |
31 | #include <lib3270.h> | 31 | #include <lib3270.h> |
32 | #include <lib3270/toggle.h> | 32 | #include <lib3270/toggle.h> |
33 | + #include <lib3270/properties.h> | ||
33 | 34 | ||
34 | /*--[ Widget definition ]----------------------------------------------------------------------------*/ | 35 | /*--[ Widget definition ]----------------------------------------------------------------------------*/ |
35 | 36 | ||
@@ -108,7 +109,7 @@ | @@ -108,7 +109,7 @@ | ||
108 | 109 | ||
109 | GtkWidget * v3270_toggle_button_new(LIB3270_TOGGLE_ID id) | 110 | GtkWidget * v3270_toggle_button_new(LIB3270_TOGGLE_ID id) |
110 | { | 111 | { |
111 | - const LIB3270_TOGGLE * toggle = lib3270_toggle_get_from_id(id); | 112 | + const LIB3270_PROPERTY * toggle = (const LIB3270_PROPERTY *) lib3270_toggle_get_from_id(id); |
112 | 113 | ||
113 | if(!toggle) | 114 | if(!toggle) |
114 | return NULL; | 115 | return NULL; |
@@ -117,13 +118,13 @@ | @@ -117,13 +118,13 @@ | ||
117 | 118 | ||
118 | widget->id = id; | 119 | widget->id = id; |
119 | 120 | ||
120 | - gtk_widget_set_name(GTK_WIDGET(widget),toggle->name); | ||
121 | - gtk_button_set_label(GTK_BUTTON(widget),gettext(toggle->label)); | 121 | + gtk_widget_set_name(GTK_WIDGET(widget),lib3270_property_get_name(toggle)); |
122 | + gtk_button_set_label(GTK_BUTTON(widget),lib3270_property_get_label(toggle)); | ||
122 | 123 | ||
123 | - if(toggle->description) | ||
124 | - gtk_widget_set_tooltip_text(GTK_WIDGET(widget),gettext(toggle->description)); | ||
125 | - else if(toggle->summary) | ||
126 | - gtk_widget_set_tooltip_text(GTK_WIDGET(widget),gettext(toggle->summary)); | 124 | + const char * tooltip = lib3270_property_get_tooltip(toggle); |
125 | + | ||
126 | + if(tooltip && *tooltip) | ||
127 | + gtk_widget_set_tooltip_text(GTK_WIDGET(widget),tooltip); | ||
127 | 128 | ||
128 | gtk_widget_set_sensitive(GTK_WIDGET(widget),FALSE); | 129 | gtk_widget_set_sensitive(GTK_WIDGET(widget),FALSE); |
129 | 130 |
src/filetransfer/v3270ftprogress.c
@@ -602,7 +602,7 @@ static void ft_failed(H3270 *hSession, unsigned long length,double kbytes_sec,co | @@ -602,7 +602,7 @@ static void ft_failed(H3270 *hSession, unsigned long length,double kbytes_sec,co | ||
602 | while(*text && g_ascii_isspace(*text)) | 602 | while(*text && g_ascii_isspace(*text)) |
603 | text++; | 603 | text++; |
604 | 604 | ||
605 | - delay_signal(hSession, V3270FTPROGRESS_SIGNAL_FAILED, text, gettext(ftmsg[f].text)); | 605 | + delay_signal(hSession, V3270FTPROGRESS_SIGNAL_FAILED, text, g_dgettext(PACKAGE_NAME,ftmsg[f].text)); |
606 | 606 | ||
607 | return; | 607 | return; |
608 | 608 | ||
@@ -664,7 +664,7 @@ static void ft_message(G_GNUC_UNUSED H3270 *hSession, const char *text, void *wi | @@ -664,7 +664,7 @@ static void ft_message(G_GNUC_UNUSED H3270 *hSession, const char *text, void *wi | ||
664 | debug("%s(%s,%p)",__FUNCTION__,text,widget); | 664 | debug("%s(%s,%p)",__FUNCTION__,text,widget); |
665 | 665 | ||
666 | if(widget) { | 666 | if(widget) { |
667 | - v3270ftprogress_set_header(GTK_WIDGET(widget),gettext(text)); | 667 | + v3270ftprogress_set_header(GTK_WIDGET(widget),text); |
668 | } | 668 | } |
669 | } | 669 | } |
670 | 670 | ||
@@ -691,7 +691,7 @@ static void ft_aborting(G_GNUC_UNUSED H3270 *hSession, const char *reason, void | @@ -691,7 +691,7 @@ static void ft_aborting(G_GNUC_UNUSED H3270 *hSession, const char *reason, void | ||
691 | static void ft_state_changed(G_GNUC_UNUSED H3270 *hSession, G_GNUC_UNUSED LIB3270_FT_STATE state, const char *text, void *widget) { | 691 | static void ft_state_changed(G_GNUC_UNUSED H3270 *hSession, G_GNUC_UNUSED LIB3270_FT_STATE state, const char *text, void *widget) { |
692 | 692 | ||
693 | if(widget) { | 693 | if(widget) { |
694 | - v3270ftprogress_set_header(GTK_WIDGET(widget),gettext(text)); | 694 | + v3270ftprogress_set_header(GTK_WIDGET(widget),text); |
695 | } | 695 | } |
696 | 696 | ||
697 | } | 697 | } |
@@ -751,9 +751,9 @@ void v3270ftprogress_start_transfer(GtkWidget *widget) { | @@ -751,9 +751,9 @@ void v3270ftprogress_start_transfer(GtkWidget *widget) { | ||
751 | 751 | ||
752 | if(!ft) { | 752 | if(!ft) { |
753 | 753 | ||
754 | - if(message) { | 754 | + if(message && *message) { |
755 | 755 | ||
756 | - g_signal_emit(GTK_WIDGET(widget),v3270ftprogress_signal[V3270FTPROGRESS_SIGNAL_FAILED], 0, gettext(message), NULL); | 756 | + g_signal_emit(GTK_WIDGET(widget),v3270ftprogress_signal[V3270FTPROGRESS_SIGNAL_FAILED], 0, message, NULL); |
757 | 757 | ||
758 | } else { | 758 | } else { |
759 | 759 |
src/include/v3270/actions.h
@@ -95,6 +95,7 @@ | @@ -95,6 +95,7 @@ | ||
95 | LIB3270_EXPORT gboolean v3270_accelerator_compare(const V3270Accelerator * accel, const guint keyval, const GdkModifierType mods); | 95 | LIB3270_EXPORT gboolean v3270_accelerator_compare(const V3270Accelerator * accel, const guint keyval, const GdkModifierType mods); |
96 | LIB3270_EXPORT const gchar * v3270_accelerator_get_name(const V3270Accelerator * accel); | 96 | LIB3270_EXPORT const gchar * v3270_accelerator_get_name(const V3270Accelerator * accel); |
97 | LIB3270_EXPORT const gchar * v3270_accelerator_get_description(const V3270Accelerator * accel); | 97 | LIB3270_EXPORT const gchar * v3270_accelerator_get_description(const V3270Accelerator * accel); |
98 | + LIB3270_EXPORT const gchar * v3270_accelerator_get_summary(const V3270Accelerator * accel); | ||
98 | 99 | ||
99 | /// @brief Converts the accelerator into a string which can be used to represent the accelerator to the user. | 100 | /// @brief Converts the accelerator into a string which can be used to represent the accelerator to the user. |
100 | /// @return A newly-allocated string representing the accelerator. | 101 | /// @return A newly-allocated string representing the accelerator. |
src/terminal/actions/lib3270.c
@@ -100,6 +100,7 @@ | @@ -100,6 +100,7 @@ | ||
100 | 100 | ||
101 | void Lib3270Action_init(Lib3270Action *action) { | 101 | void Lib3270Action_init(Lib3270Action *action) { |
102 | action->parent.activate = activate; | 102 | action->parent.activate = activate; |
103 | + action->parent.translation_domain = lib3270_get_translation_domain(); | ||
103 | } | 104 | } |
104 | 105 | ||
105 | GAction * g_action_new_from_lib3270(const LIB3270_ACTION * definition) { | 106 | GAction * g_action_new_from_lib3270(const LIB3270_ACTION * definition) { |
src/terminal/actions/save.c
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | debug("%s(%d)",__FUNCTION__,((int) action->flags)); | 43 | debug("%s(%d)",__FUNCTION__,((int) action->flags)); |
44 | 44 | ||
45 | if(((int) action->flags) < 0) | 45 | if(((int) action->flags) < 0) |
46 | - mode = lib3270_has_selection(GTK_V3270(widget)->host) ? LIB3270_CONTENT_SELECTED : LIB3270_CONTENT_ALL; | 46 | + mode = lib3270_get_has_selection(GTK_V3270(widget)->host) ? LIB3270_CONTENT_SELECTED : LIB3270_CONTENT_ALL; |
47 | 47 | ||
48 | GtkWidget *dialog = v3270_save_dialog_new(widget,mode,NULL); | 48 | GtkWidget *dialog = v3270_save_dialog_new(widget,mode,NULL); |
49 | gtk_widget_show_all(dialog); | 49 | gtk_widget_show_all(dialog); |
src/terminal/actions/table.c
@@ -68,6 +68,8 @@ | @@ -68,6 +68,8 @@ | ||
68 | .group = LIB3270_ACTION_GROUP_SELECTION, | 68 | .group = LIB3270_ACTION_GROUP_SELECTION, |
69 | .icon = "edit-copy", | 69 | .icon = "edit-copy", |
70 | .label = N_( "Copy" ), | 70 | .label = N_( "Copy" ), |
71 | + .summary = N_("Copy selection to clipboard"), | ||
72 | + .description = N_("Replace current clipboard contents with the selected area"), | ||
71 | .key = 'c', | 73 | .key = 'c', |
72 | .mods = GDK_CONTROL_MASK, | 74 | .mods = GDK_CONTROL_MASK, |
73 | .activate = fire_copy_accelerator | 75 | .activate = fire_copy_accelerator |
@@ -78,6 +80,8 @@ | @@ -78,6 +80,8 @@ | ||
78 | .group = LIB3270_ACTION_GROUP_SELECTION, | 80 | .group = LIB3270_ACTION_GROUP_SELECTION, |
79 | .name = "copy-append", | 81 | .name = "copy-append", |
80 | .label = N_( "Add to copy" ), | 82 | .label = N_( "Add to copy" ), |
83 | + .summary = N_("Append selection to clipboard"), | ||
84 | + .description = N_("Append selected area to current clipboard contents"), | ||
81 | .key = 'c', | 85 | .key = 'c', |
82 | .mods = GDK_ALT_MASK, | 86 | .mods = GDK_ALT_MASK, |
83 | .activate = fire_copy_accelerator | 87 | .activate = fire_copy_accelerator |
@@ -159,6 +163,8 @@ | @@ -159,6 +163,8 @@ | ||
159 | .name = "paste", | 163 | .name = "paste", |
160 | .icon = "edit-paste", | 164 | .icon = "edit-paste", |
161 | .label = N_("Paste"), | 165 | .label = N_("Paste"), |
166 | + .summary = N_("Paste clipboard contents"), | ||
167 | + .description = N_("Input current clipboard contents to screen"), | ||
162 | .key = 'v', | 168 | .key = 'v', |
163 | .mods = GDK_CONTROL_MASK, | 169 | .mods = GDK_CONTROL_MASK, |
164 | .activate = fire_paste_accelerator | 170 | .activate = fire_paste_accelerator |
@@ -193,6 +199,7 @@ | @@ -193,6 +199,7 @@ | ||
193 | .name = "zoom-in", | 199 | .name = "zoom-in", |
194 | .icon = "zoom-in", | 200 | .icon = "zoom-in", |
195 | .label = N_("Zoom in"), | 201 | .label = N_("Zoom in"), |
202 | + .summary = N_("Increase the font size"), | ||
196 | .key = GDK_KP_Add, | 203 | .key = GDK_KP_Add, |
197 | .mods = GDK_CONTROL_MASK, | 204 | .mods = GDK_CONTROL_MASK, |
198 | .activate = fire_zoom_action | 205 | .activate = fire_zoom_action |
@@ -203,6 +210,7 @@ | @@ -203,6 +210,7 @@ | ||
203 | .group = LIB3270_ACTION_GROUP_ONLINE, | 210 | .group = LIB3270_ACTION_GROUP_ONLINE, |
204 | .name = "zoom-out", | 211 | .name = "zoom-out", |
205 | .label = N_("Zoom out"), | 212 | .label = N_("Zoom out"), |
213 | + .summary = N_("decrease the font size"), | ||
206 | .icon = "zoom-out", | 214 | .icon = "zoom-out", |
207 | .key = GDK_KP_Subtract, | 215 | .key = GDK_KP_Subtract, |
208 | .mods = GDK_CONTROL_MASK, | 216 | .mods = GDK_CONTROL_MASK, |
@@ -214,7 +222,7 @@ | @@ -214,7 +222,7 @@ | ||
214 | .group = LIB3270_ACTION_GROUP_ONLINE, | 222 | .group = LIB3270_ACTION_GROUP_ONLINE, |
215 | .name = "zoom-fit-best", | 223 | .name = "zoom-fit-best", |
216 | .label = N_("Fit best"), | 224 | .label = N_("Fit best"), |
217 | - .summary = N_("Zoom to best size"), | 225 | + .summary = N_("Set the font to the best size for window"), |
218 | .icon = "zoom-fit-best", | 226 | .icon = "zoom-fit-best", |
219 | .key = '0', | 227 | .key = '0', |
220 | .mods = GDK_CONTROL_MASK, | 228 | .mods = GDK_CONTROL_MASK, |
@@ -288,6 +296,7 @@ | @@ -288,6 +296,7 @@ | ||
288 | .name = "print-all", | 296 | .name = "print-all", |
289 | .icon = "document-print", | 297 | .icon = "document-print", |
290 | .label = N_("Print screen"), | 298 | .label = N_("Print screen"), |
299 | + .summary = N_("Print the entire screen"), | ||
291 | .activate = fire_print_action | 300 | .activate = fire_print_action |
292 | 301 | ||
293 | }, | 302 | }, |
src/terminal/actions/toggle.c
@@ -117,6 +117,7 @@ | @@ -117,6 +117,7 @@ | ||
117 | 117 | ||
118 | void Lib3270ToggleAction_init(Lib3270ToggleAction *action) { | 118 | void Lib3270ToggleAction_init(Lib3270ToggleAction *action) { |
119 | action->parent.activate = activate; | 119 | action->parent.activate = activate; |
120 | + action->parent.translation_domain = lib3270_get_translation_domain(); | ||
120 | } | 121 | } |
121 | 122 | ||
122 | GAction * g_action_new_from_toggle(const LIB3270_TOGGLE * definition) { | 123 | GAction * g_action_new_from_toggle(const LIB3270_TOGGLE * definition) { |
src/terminal/keyboard/accelerator.c
@@ -33,6 +33,7 @@ | @@ -33,6 +33,7 @@ | ||
33 | #include <terminal.h> | 33 | #include <terminal.h> |
34 | #include <lib3270/actions.h> | 34 | #include <lib3270/actions.h> |
35 | #include <v3270/actions.h> | 35 | #include <v3270/actions.h> |
36 | + #include <lib3270/properties.h> | ||
36 | 37 | ||
37 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 38 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
38 | 39 | ||
@@ -150,50 +151,86 @@ | @@ -150,50 +151,86 @@ | ||
150 | 151 | ||
151 | } | 152 | } |
152 | 153 | ||
153 | - const gchar * v3270_accelerator_get_description(const V3270Accelerator * accel) | ||
154 | - { | ||
155 | - switch(accel->type) | ||
156 | - { | ||
157 | - case V3270_ACCELERATOR_TYPE_LIB3270_ACTION: | 154 | + const gchar * v3270_accelerator_get_summary(const V3270Accelerator * accel) { |
158 | 155 | ||
159 | - if( ((LIB3270_ACTION *) accel->arg)->summary ) | ||
160 | - return gettext(((LIB3270_ACTION *) accel->arg)->summary); | 156 | + const gchar * description = NULL; |
157 | + const LIB3270_PROPERTY * property = (const LIB3270_PROPERTY *) accel->arg; | ||
161 | 158 | ||
162 | - if( ((LIB3270_ACTION *) accel->arg)->description ) | ||
163 | - return gettext(((LIB3270_ACTION *) accel->arg)->description); | 159 | + switch(accel->type) { |
160 | + case V3270_ACCELERATOR_TYPE_LIB3270_ACTION: | ||
161 | + debug("%s","V3270_ACCELERATOR_TYPE_LIB3270_ACTION"); | ||
162 | + description = lib3270_property_get_summary(property); | ||
163 | + break; | ||
164 | 164 | ||
165 | + case V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE: | ||
166 | + debug("%s","V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE"); | ||
167 | + description = lib3270_property_get_summary(property); | ||
165 | break; | 168 | break; |
166 | 169 | ||
167 | case V3270_ACCELERATOR_TYPE_INTERNAL: | 170 | case V3270_ACCELERATOR_TYPE_INTERNAL: |
171 | + debug("%s","V3270_ACCELERATOR_TYPE_INTERNAL"); | ||
172 | + if(property->summary) | ||
173 | + description = g_dgettext(PACKAGE_NAME,property->summary); | ||
174 | + break; | ||
168 | 175 | ||
169 | - if( ((V3270_ACTION *) accel->arg)->summary ) | ||
170 | - return g_dgettext(PACKAGE_NAME,((V3270_ACTION *) accel->arg)->summary); | 176 | + case V3270_ACCELERATOR_TYPE_PFKEY: |
177 | + debug("%s","V3270_ACCELERATOR_TYPE_PFKEY"); | ||
171 | 178 | ||
172 | - if( ((V3270_ACTION *) accel->arg)->description ) | ||
173 | - return g_dgettext(PACKAGE_NAME,((V3270_ACTION *) accel->arg)->description); | 179 | + if( ((V3270PFKeyAccelerator *)accel)->description ) |
180 | + description = g_dgettext(PACKAGE_NAME,((V3270PFKeyAccelerator *)accel)->description); | ||
174 | 181 | ||
175 | break; | 182 | break; |
176 | 183 | ||
177 | - case V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE: | 184 | + } |
185 | + | ||
186 | + debug("%s=%s",__FUNCTION__,description); | ||
178 | 187 | ||
179 | - if(((LIB3270_TOGGLE *) accel->arg)->summary) | ||
180 | - return gettext(((LIB3270_TOGGLE *) accel->arg)->summary); | 188 | + if(description && *description) |
189 | + return description; | ||
181 | 190 | ||
182 | - if(((LIB3270_TOGGLE *) accel->arg)->description) | ||
183 | - return gettext(((LIB3270_TOGGLE *) accel->arg)->description); | 191 | + return ""; |
192 | + } | ||
184 | 193 | ||
194 | + const gchar * v3270_accelerator_get_description(const V3270Accelerator * accel) { | ||
195 | + | ||
196 | + const gchar * description = NULL; | ||
197 | + const LIB3270_PROPERTY * property = (const LIB3270_PROPERTY *) accel->arg; | ||
198 | + | ||
199 | + switch(accel->type) { | ||
200 | + case V3270_ACCELERATOR_TYPE_LIB3270_ACTION: | ||
201 | + debug("%s","V3270_ACCELERATOR_TYPE_LIB3270_ACTION"); | ||
202 | + description = lib3270_property_get_description(property); | ||
203 | + break; | ||
204 | + | ||
205 | + case V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE: | ||
206 | + debug("%s","V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE"); | ||
207 | + description = lib3270_property_get_description(property); | ||
208 | + break; | ||
209 | + | ||
210 | + case V3270_ACCELERATOR_TYPE_INTERNAL: | ||
211 | + debug("%s","V3270_ACCELERATOR_TYPE_INTERNAL"); | ||
212 | + if(property->description) | ||
213 | + description = g_dgettext(PACKAGE_NAME,property->description); | ||
214 | + else if(property->summary) | ||
215 | + description = g_dgettext(PACKAGE_NAME,property->summary); | ||
185 | break; | 216 | break; |
186 | 217 | ||
187 | case V3270_ACCELERATOR_TYPE_PFKEY: | 218 | case V3270_ACCELERATOR_TYPE_PFKEY: |
219 | + debug("%s","V3270_ACCELERATOR_TYPE_PFKEY"); | ||
188 | 220 | ||
189 | if( ((V3270PFKeyAccelerator *)accel)->description ) | 221 | if( ((V3270PFKeyAccelerator *)accel)->description ) |
190 | - return g_dgettext(PACKAGE_NAME,((V3270PFKeyAccelerator *)accel)->description); | 222 | + description = g_dgettext(PACKAGE_NAME,((V3270PFKeyAccelerator *)accel)->description); |
191 | 223 | ||
192 | break; | 224 | break; |
193 | 225 | ||
194 | } | 226 | } |
195 | 227 | ||
196 | - return v3270_accelerator_get_name(accel); | 228 | + debug("%s=%s",__FUNCTION__,description); |
229 | + | ||
230 | + if(description && *description) | ||
231 | + return description; | ||
232 | + | ||
233 | + return ""; | ||
197 | } | 234 | } |
198 | 235 | ||
199 | const gchar * v3270_accelerator_get_name(const V3270Accelerator * accel) | 236 | const gchar * v3270_accelerator_get_name(const V3270Accelerator * accel) |
@@ -201,13 +238,9 @@ | @@ -201,13 +238,9 @@ | ||
201 | switch(accel->type) | 238 | switch(accel->type) |
202 | { | 239 | { |
203 | case V3270_ACCELERATOR_TYPE_LIB3270_ACTION: | 240 | case V3270_ACCELERATOR_TYPE_LIB3270_ACTION: |
204 | - return ((LIB3270_ACTION *) accel->arg)->name; | ||
205 | - | ||
206 | case V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE: | 241 | case V3270_ACCELERATOR_TYPE_LIB3270_TOGGLE: |
207 | - return ((LIB3270_TOGGLE *) accel->arg)->name; | ||
208 | - | ||
209 | case V3270_ACCELERATOR_TYPE_INTERNAL: | 242 | case V3270_ACCELERATOR_TYPE_INTERNAL: |
210 | - return ((V3270_ACTION *) accel->arg)->name; | 243 | + return lib3270_property_get_name((const LIB3270_PROPERTY *) accel->arg); |
211 | 244 | ||
212 | case V3270_ACCELERATOR_TYPE_CUSTOM: | 245 | case V3270_ACCELERATOR_TYPE_CUSTOM: |
213 | return ((V3270CustomAccelerator *) accel)->name; | 246 | return ((V3270CustomAccelerator *) accel)->name; |
src/testprogram/testprogram.c
@@ -44,6 +44,8 @@ | @@ -44,6 +44,8 @@ | ||
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | #include <gdk/gdkkeysyms-compat.h> | 45 | #include <gdk/gdkkeysyms-compat.h> |
46 | #include <locale.h> | 46 | #include <locale.h> |
47 | + #include <libintl.h> | ||
48 | + | ||
47 | 49 | ||
48 | /*---[ Implement ]----------------------------------------------------------------------------------*/ | 50 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
49 | 51 |