1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

fset: add ${description_en}

This commit is contained in:
Sébastien Helleu
2017-05-31 22:32:56 +02:00
parent 3211a73599
commit eccce0bb4f
3 changed files with 36 additions and 7 deletions
+1 -1
View File
@@ -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)),
+19 -2
View File
@@ -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");
+16 -4
View File
@@ -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)
@@ -516,6 +515,13 @@ fset_option_set_max_length_fields_option (struct t_fset_option *fset_option)
"max", weechat_strlen_screen (fset_option->max));
/* 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));
@@ -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;