[sane-devel] Where is the define of SANE_I18N
Olaf Meeuwissen
paddy-hack at member.fsf.org
Wed Jul 5 11:52:45 UTC 2017
Hi,
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
More information about the sane-devel
mailing list