[GRASS-dev] translated options in descriptions

Hamish hamish_b at yahoo.com
Sun Aug 12 13:19:23 PDT 2012


Anna wrote:
> I would like to point out that there was a bug in many
> modules (around 30) which can appear only with localised grass
> (fixed r52637). It produces only warning so probably it's
> harmless however developers should avoid using option
> descriptions in this way:
> 
> -    params->query->descriptions =
> -       _("length;Select only lines or boundaries shorter"
> -         "/longer than threshold distance;"
> -         "dangle;Select dangles shorter/longer than " "threshold distance");
> 
> The problems appear when the translator translates the
> option and not only its description. Translatable must be only
> the description like this,
> 
> +    desc_query = NULL;
> +    G_asprintf(&desc_query,
> +               "length;%s;"
> +              "dangle;%s",
> +              _("Select only lines or boundaries shorter"
> +                "/longer than threshold distance"),
> +              _("Select dangles shorter/longer than threshold distance"));
> +    params->query->descriptions = desc_query;


is it a problem that G_asprint() can, in some rare cases, call
G_fatal_error() (via G_calloc()) before G_parser() has been
run? or is G_define_module() the critical fn to get past in that
regard?


best,
Hamish


More information about the grass-dev mailing list