[sane-standard] sane standard proposals (4) "translation"

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 11 Oct 2004 18:50:21 +0200


Hi,

On Mon, Oct 11, 2004 at 02:41:18AM +0200, Johannes Berg wrote:
> The SANE standard specifies how backends should mark their strings for
> translation, and that frontends are responsible for actually translating
> the messages.

Well, they are responsible for using a mecahnism to translate the
messages. It's not the responsibility of the frontend authors to
actually translate the options or to include the translations in their
tar ball. That's why the .po files come with sane-backends.

> I think it is unfair to ask each frontend to be able to translate all
> strings that could possibly occur, and this is also impossible if you
> deploy a new scanner backend on a network server without updating client
> software.

That's one of the reasons for the discussions about how to transport
the .mo files by using SANE API calls. These discussions should be
somewhere in the sane-devel archive.

So yes, the frontend should be able to get the translation from the
backend somehow, but we haven't decided on how to do that exactly.
 
> Therefore, I propose that translations be associated to the backends by
> way of naming files ("/some/where/de/coolscan2.mo")

Once the translations where splitted by backend. We (I guess it was
mostly me) decided to merge all the translations to one file per
language. One reason is that there are many options that are used by
more than one backend. The second is that the chaos just gets to big.
Imagine 50 backends with 10 languages ...

> and that an API be added to access these translations from a
> frontend, without knowing about the strings itself.

The idea was to just use something like:

SANE_Status 
sane_get_translation (SANE_String_Const language_code, SANE_Byte **mo_data)

That needs more thoughts (e.g. about who frees the buffer etc.).

Another way would be:

SANE_String
sane_gettext (SANE_String_Const text_to_be_translated)

I don't remember why we haven't discussed that one (maybe it's too
slow?)

We should also keep in mind the way the dll/meta backends work: The
response to both functions comes from the dll backend if no
SANE_Handle parameter is added.

Bye,
  Henning