Roger Leigh wrote:

I've now built a new set of packages, and the generated data is
(AFAICT) all ASCII-only. ...
Does this fix the problem?


Yes, it's fine now. Thanks for your quick work! But see below....

... CUPS is serving it as
    Content-Type: text/html;charset=iso-8859-15

That is weird. I've no explanation for that one! If this still occurs with the fixed packages, please file a bug against cupsys.

Yes it still happens. It looks the same as an existing i18n bug filed
against cupsys:
  #259881: cupsys: Doesn't detect charset when getting printer info
from OS X

-----------------------------------------------------------------
... 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

+ 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.

CUPS will still live in its own Latin-15 world :(, but you will be doing
the right thing.

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

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

+ 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)


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.


Thanks,

Richard.







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



Reply via email to