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


[sane-devel] sane-pixma and Canon MF8380Cdw

2017-10-01 Thread Harri T.
Hi,

I'm trying to connect a Canon MF8380Cdw multifunction device to my Linux 
Stretch laptop. Windows PCs seem to communicate with the ports TCP/8610 and 
UDP/8610 when scanning. I checked that with Wireshark.

The folloing line is added to /etc/sane.d/pixma.conf:

mfnp://192.168.0.51:8610

However, the scanner is not found:

[0] mypc:~>scanimage --version
scanimage (sane-backends) 1.0.25; backend version 1.0.25

[0] mypc:~>scanimage  
scanimage: no SANE devices found

[0] mypc:~>strace scanimage:
...
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 36
connect(36, {sa_family=AF_INET, sin_port=htons(8610), 
sin_addr=inet_addr("192.168.0.51")}, 16) = 0
sendto(36, "MFNP\2\1\0\0\0\0\0\0\0\0\0\0", 16, 0, NULL, 0) = 16
select(37, [36], NULL, NULL, {tv_sec=4, tv_usec=0}) = 1 (in [36], left 
{tv_sec=3, tv_usec=997255})
recvfrom(36, 
"MFNP\202\1\0\0\0\0\0\0\0\0\0\20\0\1\200\0\6\4t/hO\327b\300\250\2\25", 2048, 0, 
NULL, NULL) = 32
close(36)   = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 36
connect(36, {sa_family=AF_INET, sin_port=htons(8610), 
sin_addr=inet_addr("192.168.0.51")}, 16) = 0
sendto(36, "MFNP\0020\0\0\0\1\0\0\0\0\0\0", 16, 0, NULL, 0) = 16
select(37, [36], NULL, NULL, {tv_sec=4, tv_usec=0}) = 1 (in [36], left 
{tv_sec=3, tv_usec=982931})
recvfrom(36, "MFNP\2020\0\0\0\1\0\0\0\0\0VMFG:CANON;CMD:MF"..., 2048, 0, NULL, 
NULL) = 102
close(36)  
...

Does this mean that SANE connects to the device but the model is not supported?

Best regards,

Harri

-- 
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