-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Cohen <[EMAIL PROTECTED]> writes:

> ... I took a look at genppd.c (and the code from HEAD) and have a few
> suggestions:
>
> + In Makefile.am, specify the catalog for the C locale, like you for
> nls, so that it doesn't pick up one from /usr/share/locale:
>
>       for language in C ; do \
>         mkdir ppd/$$language ; \
>         echo "$$language:" ; \
>         LANGUAGE=$$language ./genppd --prefix=ppd/$$language
> --catalog=`pwd`/catalog/share/locale; \
>       done

That's a good idea.

> + when writing out the ppd, use the encoding from the message catalog:
>
>   {
>     const char* ppd_encoding=_("ISOLatin1");
>
>     if (!strcmp(ppd_encoding, "ISOLatin1"))
>       bind_textdomain_codeset(PACKAGE, "ISO-8859-1");
>     else if (!strcmp(ppd_encoding, "ISOLatin2"))
>       bind_textdomain_codeset(PACKAGE, "ISO-8859-2");
>     /*
>        else if (!strcmp(ppd_encoding, "ISOLatin7"))
>        bind_textdomain_codeset(PACKAGE, "ISO-8859-7");
>
>        ... any other possible PPD LanguageEncoding ...
>     */
>     else if (!strcmp(ppd_encoding, "UTF-8"))
>       bind_textdomain_codeset(PACKAGE, "ISO-8859-1");
>     else
>     {
>       fprintf(stderr, "genppd: unrecognized encoding in catalog: %s\n",
>            ppd_encoding);
>       exit(1);
>     }
>   }
> and maybe add a gentle warning if it's not the same as the locale encoding.

There's a whole range of problems with this, the main one being the
need to know the encoding in advance.  That said, I think it's
probably the best solution at present.  The reason it's such a mess is
due to the non-portability of the gettext extensions required to get
it to work reasonably at all.  The PPD spec is also nasty in the way
it specifies languages and encodings.

After 5.0.0 is released, I'd like to look at the feasability of moving
all the translations to UTF-8 to make this managable.  There are also
proposals to extend the PPD spec with all the translations in a single
PPD file (currently it's impractical to provide translated
PPDs--there's over 20 megabytes of files, mostly identical; to get
around distribution issues they are generated at install time with
5.0.0).  If there was just one file per printer, that would be rather
more manageable.

> + "ISOLatin1" and "English" are wrongly translated in el.po and ja.po.

Thanks, I'll bring that up.

> + Shouldn't you use --language in ppd-nls, so that StpLocale &
> StpPPDLocation are filled in correctly ?

Yes, that's a bug.  I think both -p and -l need fixing to get this
working correctly (otherwise you will get the language twice).

> + LANGUAGE= is not portable (yes, I've read the README), and it would
> be better to hide it inside genppd.c under the --language option,
> something like
>       unsetenv("LANG"), unsetenv("LANGUAGE"), setenv("LC_ALL", language, 1)
> or even just
>       unsetenv("LANGUAGE"), setlocale("LC_MESSAGES", language)

We used to do just that, but there was a reason for having it set
beforehand.  IIRC they might be accessed before main(), unlikely as it
seems.  It might be worth revisiting that.

> If *really* necessary, you could use a configure macro.
>
> + Ideally, of course, CUPS would do the localisation at runtime when a
> client asks for the PPD.

Yes, that would be ideal.  Unfortunately, the PPDs have to be used
with printing systems other than CUPS (e.g. Windows clients with a
PostScript driver), and these wouldn't be aware of any i18n facilities
and wouldn't have access to the message catalogues.  The PPD
localisation proposal made by Patrick Powell (the LPRng maintainer)
last summer should correct this (and be backward-compatible) by
allowing the client to choose from a range of supported languages
stored within the PPD.


Thanks *very much* for your input on this.  This is one area that has
been a huge nightmare for me, and your suggestions look like they
might well fix a number of the problems.


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFCBmbyVcFcaSW/uEgRAj64AKDbCkNYf7YbkWA2KNS3iUNy0m7cGQCgo9VA
rv7H5gyNgkzhvP8wxQ/QVJ0=
=tT1V
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to