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

Hi,

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

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