bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#113988: Bug#355367: debuild: Preserving locale settings can affe


From: Sven Joachim
Subject: Re: Bug#113988: Bug#355367: debuild: Preserving locale settings can affect build
Date: Thu, 09 Mar 2006 09:52:37 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051017)

Norbert Preining wrote:

1) The header of the info files is in German:

Dies ist


fixed.

Can you send a patch?

2) Error messages by makeinfo are printed in English, which I noticed by
  running "makeinfo --html" from the lispref directory in the Emacs
  sources.


Hmm, this is strange, very strange. Do you have some experience with
locales? What could be wrong with this function:
char *
getdocumenttext (const char *msgid)
{
  char *save_locale;
  char *s;
  save_locale = setlocale(LC_ALL, NULL);
  setlocale(LC_ALL, interface_language);
  s = gettext(msgid);
  setlocale(LC_ALL, save_locale);
  return(s);
}

The libc info page for setlocale tells you what's wrong with it:

     The string returned by `setlocale' can be overwritten by subsequent
     calls, so you should make a copy of the string (*note Copying and
     Concatenation::) if you want to save it past any further calls to
     `setlocale'.  (The standard library is guaranteed never to call
     `setlocale' itself.)

With that information, it's easy to correct your getdocumenttext
function:

char *
getdocumenttext (const char *msgid)
{
  char *old_locale, *save_locale;
  char *s;
  old_locale = setlocale(LC_ALL, NULL);
  save_locale = strdup (old_locale);
  setlocale(LC_ALL, interface_language);
  s = gettext(msgid);
  setlocale(LC_ALL, save_locale);
  return(s);
}

With that, I got makeinfo's error messages in German. :-)

Best wishes,
            Sven








reply via email to

[Prev in Thread] Current Thread [Next in Thread]