Discussion:
Where is the define of SANE_I18N
Add Reply
D***@pek.destiny.com.cn
2017-07-05 01:33:36 UTC
Reply
Permalink
Raw Message
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?



===========================

Unus pro omnibus, omnes pro uno

-Dan✉<mailto:***@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.

本郵件(含所有附件)包含受法埋保護以及機密之資蚊僅䟛本郵件指定的收件人䜿甚。劂果悚䞊非指定的收件人請立即以電子郵件通知寄件人䞊將本郵件及所有耇印本刪陀。請泚意非經授權嚎栌犁止閱芜、散播、散䜈或耇補本郵件及其內容。
Olaf Meeuwissen
2017-07-05 11:52:45 UTC
Reply
Permalink
Raw Message
Hi,
Post by D***@pek.destiny.com.cn
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
--
sane-devel mailing list: sane-***@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-***@lists.alioth.debian.org
D***@pek.destiny.com.cn
2017-07-06 10:54:31 UTC
Reply
Permalink
Raw Message
Hi Olaf,

I got it.
Thank you for your explain.


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

Hi,

***@pek.destiny.com.cn<mailto:***@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
***@pek.destiny.com.cn<mailto:***@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.

本郵件(含所有附件)包含受法埋保護以及機密之資蚊僅䟛本郵件指定的收件人䜿甚。劂果悚䞊非指定的收件人請立即以電子郵件通知寄件人䞊將本郵件及所有耇印本刪陀。請泚意非經授權嚎栌犁止閱芜、散播、散䜈或耇補本郵件及其內容。
Loading...