Re: [sane-devel] Supported languages?

2017-10-01 Thread Jeff
On 01/10/17 19:04, Jeff Sadowski wrote:
> So if I install ubuntu on a vm for each language I want to support would
> I be able to copy the output for each language?

The messages specific to scanimage (look at the scanimage source, but
things like progress and error messages, e.g.
https://anonscm.debian.org/cgit/sane/sane-backends.git/tree/frontend/scanimage.c,
line 1919) are not translated, because scanimage hasn't tried to.

However, scanimage just passes on the strings for the option titles and
descriptions from the backend, and these are (often) translated.

Your application can do the same - just pass on the translations from
the backends (remember to use the sane-backends domain for gettext).

Obviously messages from your application you will have to translate
yourself.

> Or would it be better to do a google translate for the languages? I
> can add tables for translating the common options if need be.

NOOO! Google translate is excellent for getting the gist of
something written in a language you don't understand, but the
translations are almost always really horrible.

The standard method for translating applications in C, Perl, etc. is to
mark the strings. Tradition dictates an underscore, e.g. _"string to be
translated" but sane-backends uses SANE_I18N (e.g.
https://anonscm.debian.org/cgit/sane/sane-backends.git/tree/backend/fujitsu.c,
line 3097).

PHP uses a similar method:

http://php.net/manual/en/function.gettext.php

So having appropriately marked your strings, gettext will extract them
into a .pot file, which you can give to your translators (I use rosetta
on launchpad), and you get a .po file for each language with the
appropriate translations (or not).

You convert the .po files to .mo files when you build the application
and install them to the appropriate place, and Bob should be your uncle.

It all works for me. The strings specific to gscan2pdf I have had
translated as above, and I fetch the backend strings from the
sane-backend domain.

Regards

Jeff



signature.asc
Description: OpenPGP digital signature
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Supported languages?

2017-10-01 Thread abel deuring
Am 01.10.2017 um 19:04 schrieb Jeff Sadowski:
> I'm not sure I grasp it.
> 
> So if I install ubuntu on a vm for each language I want to support would
> I be able to copy the output for each language?

No: The i18n concept for Sane is this:

- The backends return in every case the Endlish strings as they appear
  in the source code.
- A frontend can/should use the PO files to replace the english strings
  with the desired language.

The problem is that scanimage, the frontend, does not support i18n/l10n.

Perhaps one more reason to follow Jeff's advice not to call scanimage
but to write a Sane library for PHP ;)

> Or would it be better to do a google translate for the languages? I can
> add tables for translating the common options if need be.

Well, the translations are all there, in .po/.mo files -- just use them
;) But again, this is much easier to do if a PHP wrapper for Sane
backends directly passes the English strings to your application than to
search for these strings in the output from scanimage.

I am not at all familiar with PHP, but I'd bet that it supports gettext().

Abel


> 
> On Sun, Oct 1, 2017 at 5:18 AM, Olaf Meeuwissen
> mailto:paddy-h...@member.fsf.org>> wrote:
> 
> Hi Yury,
> 
> Yury Tarasievich writes:
> 
> > Does scanimage actually contain the l10n
> > functionality?
> 
> Good question!
> 
> While the backends have their messages translated to some 20 languages,
> it is the SANE frontend's responsibility to activate translation.  I did
> a quick check of the scanimage source code and it doesn't seem to do so.
> 
> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Software                        https://my.fsf.org/donate
>  Join the Free Software Foundation              https://my.fsf.org/join
> 
> --
> sane-devel mailing list: sane-devel@lists.alioth.debian.org
> 
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> 
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to sane-devel-requ...@lists.alioth.debian.org
> 
> 
> 
> 
> 


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Supported languages?

2017-10-01 Thread Jeff Sadowski
I'm not sure I grasp it.

So if I install ubuntu on a vm for each language I want to support would I
be able to copy the output for each language?
Or would it be better to do a google translate for the languages? I can add
tables for translating the common options if need be.

On Sun, Oct 1, 2017 at 5:18 AM, Olaf Meeuwissen 
wrote:

> Hi Yury,
>
> Yury Tarasievich writes:
>
> > Does scanimage actually contain the l10n
> > functionality?
>
> Good question!
>
> While the backends have their messages translated to some 20 languages,
> it is the SANE frontend's responsibility to activate translation.  I did
> a quick check of the scanimage source code and it doesn't seem to do so.
>
> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Softwarehttps://my.fsf.org/donate
>  Join the Free Software Foundation  https://my.fsf.org/join
>
> --
> sane-devel mailing list: sane-devel@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>  to sane-devel-requ...@lists.alioth.debian.org
>
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Supported languages?

2017-10-01 Thread Olaf Meeuwissen
Hi Yury,

Yury Tarasievich writes:

> Does scanimage actually contain the l10n
> functionality?

Good question!

While the backends have their messages translated to some 20 languages,
it is the SANE frontend's responsibility to activate translation.  I did
a quick check of the scanimage source code and it doesn't seem to do so.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Supported languages?

2017-10-01 Thread Jeff
On 01/10/17 06:18, Yury Tarasievich wrote:
> Does scanimage actually contain the l10n functionality?

Indirectly. scanimage pulls in the option title and description from the
backend. Therefore, if the backend has translations, then scanimage will
pass them on. e.g. fujitsu:

https://anonscm.debian.org/cgit/sane/sane-backends.git/tree/backend/fujitsu.c

  if(option==OPT_GAMMA){
opt->name = "gamma";
opt->title = SANE_I18N ("Gamma function exponent");
opt->desc = SANE_I18N ("Changes intensity of midtones");

SANE_I18N is the C macro that fetches the translations.

Regards

Jeff



signature.asc
Description: OpenPGP digital signature
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Supported languages?

2017-09-30 Thread Yury Tarasievich
Does scanimage actually contain the l10n 
functionality?


-Yury

On 01/10/17 02:52, Jeff Sadowski wrote:

I set all those and I still get English.

export LANG=de_DE.utf8

...

--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Supported languages?

2017-09-30 Thread Jeff Sadowski
I set all those and I still get English.

export LANG=de_DE.utf8
export LANGUAGE=de_DE
export LC_ALL=de_DE
export LC_MESSAGES=de_DE
export LC_CTYPE=de_DE
export LANG=de_DE
export LANGUAGE=de_DE
scanimage -h

Or maybe I've been speaking German all along.
Or maybe there is a TARDIS translating it for me.

On Sat, Sep 30, 2017 at 2:33 PM, Jeff  wrote:

> On 29/09/17 21:56, Jeff Sadowski wrote:
> > I only speak english however is there a way to make scanimage print out
> > help in another language? or is scanimage english only?
>
> Assuming that the de_DE locale is installed, the following should work
> (no need to export):
>
> LC_ALL=de_DE LC_MESSAGES=de_DE LC_CTYPE=de_DE LANG=de_DE LANGUAGE=de_DE
> scanimage
>
> Regards
>
> Jeff
>
>
> --
> sane-devel mailing list: sane-devel@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>  to sane-devel-requ...@lists.alioth.debian.org
>
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Supported languages?

2017-09-30 Thread Jeff
On 29/09/17 21:56, Jeff Sadowski wrote:
> I only speak english however is there a way to make scanimage print out
> help in another language? or is scanimage english only?

Assuming that the de_DE locale is installed, the following should work
(no need to export):

LC_ALL=de_DE LC_MESSAGES=de_DE LC_CTYPE=de_DE LANG=de_DE LANGUAGE=de_DE
scanimage

Regards

Jeff



signature.asc
Description: OpenPGP digital signature
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

[sane-devel] Supported languages?

2017-09-29 Thread Jeff Sadowski
I only speak english however is there a way to make scanimage print out
help in another language? or is scanimage english only?

I tried

export LANG=de_DE.UTF-8
export LANGUAGE=de_DE
scanimage -h

and

export LANG=de_DE.utf8
export LANGUAGE=de_DE
scanimage -h

and made sure I had de_DE.UTF-8 to choose from via

locale -a|grep DE
de_DE.utf8

but I only get english. Have various systems to test from Ubuntu and Fedora
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org