diff options
-rw-r--r-- | src/plugins/fset/fset-bar-item.c | 2 | ||||
-rw-r--r-- | src/plugins/fset/fset-buffer.c | 21 | ||||
-rw-r--r-- | src/plugins/fset/fset-option.c | 20 |
3 files changed, 36 insertions, 7 deletions
diff --git a/src/plugins/fset/fset-bar-item.c b/src/plugins/fset/fset-bar-item.c index d0d28b7b0..2d7fd5a58 100644 --- a/src/plugins/fset/fset-bar-item.c +++ b/src/plugins/fset/fset-bar-item.c @@ -134,7 +134,7 @@ fset_bar_item_fset_cb (const void *pointer, void *data, ptr_fset_option->name, weechat_color ("bar_fg"), (ptr_fset_option->description && ptr_fset_option->description[0]) ? - ptr_fset_option->description : _("(no description)"), + _(ptr_fset_option->description) : _("(no description)"), weechat_color ("bar_delim"), weechat_color ("bar_fg"), weechat_color (weechat_config_string (fset_config_color_help_default_value)), diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c index eaa80f89e..4f8c89746 100644 --- a/src/plugins/fset/fset-buffer.c +++ b/src/plugins/fset/fset-buffer.c @@ -389,19 +389,36 @@ fset_buffer_display_line (int y, struct t_fset_option *fset_option) /* description */ ptr_field = weechat_hdata_string (fset_hdata_fset_option, fset_option, "description"); - snprintf (str_field, sizeof (str_field), "%s", ptr_field); + snprintf (str_field, sizeof (str_field), + "%s", (ptr_field && ptr_field[0]) ? _(ptr_field) : ""); weechat_hashtable_set (fset_buffer_hashtable_extra_vars, "__description", str_field); snprintf (str_field, sizeof (str_field), "%s%s", weechat_color (weechat_config_string (fset_config_color_description[selected_line])), - (ptr_field) ? ptr_field : ""); + (ptr_field && ptr_field[0]) ? _(ptr_field) : ""); weechat_hashtable_set (fset_buffer_hashtable_extra_vars, "_description", str_field); fset_buffer_fills_field (str_field, sizeof (str_field), "description", 64); weechat_hashtable_set (fset_buffer_hashtable_extra_vars, "description", str_field); + /* description_en */ + ptr_field = weechat_hdata_string (fset_hdata_fset_option, + fset_option, "description"); + snprintf (str_field, sizeof (str_field), "%s", ptr_field); + weechat_hashtable_set (fset_buffer_hashtable_extra_vars, + "__description_en", str_field); + snprintf (str_field, sizeof (str_field), + "%s%s", + weechat_color (weechat_config_string (fset_config_color_description[selected_line])), + (ptr_field) ? ptr_field : ""); + weechat_hashtable_set (fset_buffer_hashtable_extra_vars, + "_description_en", str_field); + fset_buffer_fills_field (str_field, sizeof (str_field), "description", 64); + weechat_hashtable_set (fset_buffer_hashtable_extra_vars, + "description_en", str_field); + /* string_values */ ptr_field = weechat_hdata_string (fset_hdata_fset_option, fset_option, "string_values"); diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c index 98c65adac..02deb94cc 100644 --- a/src/plugins/fset/fset-option.c +++ b/src/plugins/fset/fset-option.c @@ -389,8 +389,7 @@ fset_option_set_values (struct t_fset_option *fset_option, fset_option->description = NULL; } ptr_description = weechat_config_option_get_string (option, "description"); - fset_option->description = strdup ( - (ptr_description && ptr_description[0]) ? _(ptr_description) : ""); + fset_option->description = strdup ((ptr_description) ? ptr_description : ""); /* string_values */ if (fset_option->string_values) @@ -517,6 +516,13 @@ fset_option_set_max_length_fields_option (struct t_fset_option *fset_option) /* description */ fset_option_set_max_length_field ( + "description", + weechat_strlen_screen ( + (fset_option->description && fset_option->description[0]) ? + _(fset_option->description) : "")); + + /* description_en */ + fset_option_set_max_length_field ( "description", weechat_strlen_screen (fset_option->description)); /* string_values */ @@ -984,7 +990,9 @@ fset_option_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_string (ptr_item, "parent_name", fset_option->parent_name)) return 0; - if (!weechat_infolist_new_var_string (ptr_item, "type", fset_option_type_string[fset_option->type])) + if (!weechat_infolist_new_var_string (ptr_item, "type", _(fset_option_type_string[fset_option->type]))) + return 0; + if (!weechat_infolist_new_var_string (ptr_item, "type_en", fset_option_type_string[fset_option->type])) return 0; if (!weechat_infolist_new_var_string (ptr_item, "default_value", fset_option->default_value)) return 0; @@ -996,7 +1004,11 @@ fset_option_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_string (ptr_item, "max", fset_option->max)) return 0; - if (!weechat_infolist_new_var_string (ptr_item, "description", fset_option->description)) + if (!weechat_infolist_new_var_string (ptr_item, "description", + (fset_option->description && fset_option->description[0]) ? + _(fset_option->description) : "")) + return 0; + if (!weechat_infolist_new_var_string (ptr_item, "description_en", fset_option->description)) return 0; if (!weechat_infolist_new_var_string (ptr_item, "string_values", fset_option->description)) return 0; |