Commit c33fa918 authored by Morten Welinder's avatar Morten Welinder

Funcs: handle function group name translation better.

parent 5ca14896
......@@ -7,6 +7,12 @@
* src/sheet.c (sheet_get_nominal_printarea): Avoid UMR.
2009-07-07 Morten Welinder <terra@gnome.org>
* src/func.c (gnm_func_group_fetch): Remove.
(gnm_func_group_fetch_with_translation): Rename to
gnm_func_group_fetch.
2009-07-01 Morten Welinder <terra@gnome.org>
* configure.in (libspreadsheet_reqs): Require goffice 0.7.9
......
......@@ -204,7 +204,7 @@ scm_register_function (SCM scm_name, SCM scm_args, SCM scm_help, SCM scm_categor
desc.impl_status = GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC;
desc.test_status = GNM_FUNC_TEST_STATUS_UNKNOWN;
cat = gnm_func_group_fetch (SCM_CHARS (scm_category));
cat = gnm_func_group_fetch (SCM_CHARS (scm_category), NULL);
fndef = gnm_func_add (cat, &desc);
gnm_func_set_user_data (fndef, GINT_TO_POINTER (scm_function));
......
......@@ -340,6 +340,8 @@ static GnmFuncGroup *logic_group = NULL;
void
func_builtin_init (void)
{
const char *gname;
static GnmFuncDescriptor const builtins [] = {
{ "sum", NULL, N_("number,number,"),
help_sum, NULL, gnumeric_sum,
......@@ -375,15 +377,18 @@ func_builtin_init (void)
{ NULL }
};
math_group = gnm_func_group_fetch (N_("Mathematics"));
gname = N_("Mathematics");
math_group = gnm_func_group_fetch (gname, _(gname));
gnm_func_add (math_group, builtins + 0);
gnm_func_add (math_group, builtins + 1);
gnumeric_group = gnm_func_group_fetch (N_("Gnumeric"));
gname = N_("Gnumeric");
gnumeric_group = gnm_func_group_fetch (gname, _(gname));
gnm_func_add (gnumeric_group, builtins + 2);
gnm_func_add (gnumeric_group, builtins + 3);
logic_group = gnm_func_group_fetch (N_("Logic"));
gname = N_("Logic");
logic_group = gnm_func_group_fetch (gname, _(gname));
gnm_func_add (logic_group, builtins + 4);
}
......
......@@ -541,14 +541,7 @@ function_category_compare (gconstpointer a, gconstpointer b)
}
GnmFuncGroup *
gnm_func_group_fetch (char const *name)
{
return gnm_func_group_fetch_with_translation (name, _(name));
}
GnmFuncGroup *
gnm_func_group_fetch_with_translation (char const *name,
char const *translation)
gnm_func_group_fetch (char const *name, char const *translation)
{
GnmFuncGroup *cat = NULL;
GList *l;
......@@ -761,7 +754,7 @@ gnm_func_add (GnmFuncGroup *fn_group,
func->ref_count = 0;
if (desc->fn_args != NULL) {
/* Check those arguements */
/* Check those arguments */
for (ptr = desc->arg_spec ; *ptr ; ptr++) {
g_return_val_if_fail (strchr (valid_tokens, *ptr), NULL);
}
......@@ -845,7 +838,8 @@ gnm_func_add_placeholder (Workbook *scope,
g_return_val_if_fail (func == NULL, NULL);
if (!unknown_cat)
unknown_cat = gnm_func_group_fetch (unknown_cat_name);
unknown_cat = gnm_func_group_fetch
(unknown_cat_name, _(unknown_cat_name));
memset (&desc, 0, sizeof (GnmFuncDescriptor));
desc.name = copy_name ? g_strdup (name) : name;
......
......@@ -23,9 +23,8 @@ struct _GnmFuncGroup {
};
GnmFuncGroup *gnm_func_group_get_nth (gint n);
GnmFuncGroup *gnm_func_group_fetch (char const *name);
GnmFuncGroup *gnm_func_group_fetch_with_translation (char const *name,
char const *translation);
GnmFuncGroup *gnm_func_group_fetch (char const *name,
char const *translation);
/******************************************************************************/
......
......@@ -171,7 +171,7 @@ plugin_service_function_group_activate (GOPluginService *service, ErrorInfo **re
PluginServiceFunctionGroup *service_function_group = GNM_PLUGIN_SERVICE_FUNCTION_GROUP (service);
GO_INIT_RET_ERROR_INFO (ret_error);
service_function_group->func_group = gnm_func_group_fetch_with_translation (
service_function_group->func_group = gnm_func_group_fetch (
service_function_group->category_name,
service_function_group->translated_category_name);
GO_SLIST_FOREACH (service_function_group->function_name_list, char, fname,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment