[sane-devel] SANE2 standard revisited: i18n

Sergey Vlasov vsu@altlinux.ru
Mon, 9 Dec 2002 19:47:21 +0300


On Fri, 6 Dec 2002 20:43:52 +0100
Henning Meier-Geinitz <henning@meier-geinitz.de> wrote:

> - define string lists similar to options themselves: each entry has a name
>   (English) and a title (localized). For setting the value of the
>   option, always the name of the string list is used.
>   something like:
>   
>   SANE_Constraint_Type constraint_type;
>   union
>     {
>        const SANE_String_List *string_list;
>        const SANE_Word *word_list;
>        const SANE_Range *range;
>     }
>   constraint;
>   
> and:
> typedef struct
> {
>   SANE_String_Const name;
>   SANE_String_Const title;
> }
> SANE_String_List;

This looks like a best solution. It also can help to fix the problem
of options which are called differently in different backends, but
really do the same thing.  E.g., "Transparency Adapter" vs
"Transparency Unit" (same thing with ADF, maybe some other options).
When using separate name and title, the name (which is used by
frontends and saved in config) can be chosen from the list of some
standard names, while the title (which the user really sees) is
adjusted to the spelling in the scanner documentation.

Of course, the command-line frontends (scanimage) will then use the
name field in the command line parameters (it would be a good thing if
they don't have spaces inside, like the option names).