[sane-devel] Where is the define of SANE_I18N

DanTan at pek.destiny.com.cn DanTan at pek.destiny.com.cn
Thu Jul 6 10:54:31 UTC 2017

Hi Olaf,

I got it.
Thank you for your explain.

On 5 Jul 2017, at 7:52 PM, Olaf Meeuwissen <paddy-hack at member.fsf.org<mailto:paddy-hack at member.fsf.org>> wrote:


DanTan at pek.destiny.com.cn<mailto:DanTan at pek.destiny.com.cn> writes:

Hey guys,

I have working on the source code of sane-backends, I found the macro
SANE_I18N is used to sane’s localization. But I just found the follow
lines of it’s define

#ifndef SANE_I18N
#define SANE_I18N(text) text

The above lines, dose nothing. So I wonder how SANE_I18N translate
these backends?

The backends don't translate.  It's the responsibility of the *frontend*
to translate the strings.  The SANE_I18N macro is only the marker we use
to tell xgettext which strings should be translated.  These strings end
up in po/sane-backends.pot.

The reasoning behind making the frontend responsible for translation is
that the backend may be executing remotely (e.g. via saned).  You don't
want to get the translations suitable for a remotely executing process.
This process may execute under a different LANG setting than your local
SANE frontend.

Let's say you run your frontend with LANG=zh_CN and scan via the net
backend on a server that just happens to run saned with LANG=fr_FR.
Would you be happy with French messages?  Probably not ;-)

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

Dan Tan
dantan at pek.destiny.com.cn<mailto:dantan at pek.destiny.com.cn>


The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20170706/cc78031e/attachment.html>

More information about the sane-devel mailing list