Commit 2aa9e422 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Add $attribution_locale configuration variable.

$attribution_locale replaces the just removed $locale, but is only
used for customizing the LC_TIME locale used for dates in
$attribution.

This could be useful in conjunction with folder or send-hooks for
recipients in different locales.
parent deb6db77
......@@ -3624,8 +3624,8 @@ Example: <literal><command>send-hook</command> mutt
<para>
Another typical use for this command is to change the values of the
<link linkend="attribution">$attribution</link>, <link
linkend="signature">$signature</link> and <link
linkend="locale">$locale</link> variables in order to change the
linkend="attribution-locale">$attribution_locale</link>, and <link
linkend="signature">$signature</link> variables in order to change the
language of the attributions and signatures based upon the recipients.
</para>
......
......@@ -160,7 +160,9 @@ be_include_messages (char *msg, char **buf, int *bufmax, int *buflen,
/* add the attribution */
if (Attribution)
{
setlocale (LC_TIME, NONULL (AttributionLocale));
mutt_make_string (tmp, sizeof (tmp) - 1, Attribution, Context, Context->hdrs[n]);
setlocale (LC_TIME, "");
strcat (tmp, "\n"); /* __STRCAT_CHECKED__ */
}
......
......@@ -36,6 +36,7 @@ WHERE char *AliasFmt;
WHERE char *AssumedCharset;
WHERE char *AttachSep;
WHERE char *Attribution;
WHERE char *AttributionLocale;
WHERE char *AttachCharset;
WHERE char *AttachFormat;
WHERE char *Charset;
......
......@@ -266,6 +266,18 @@ struct option_t MuttVars[] = {
** in a reply. For a full listing of defined \fCprintf(3)\fP-like sequences see
** the section on $$index_format.
*/
{ "attribution_locale", DT_STR, R_NONE, UL &AttributionLocale, UL "" },
/*
** .pp
** The locale used by \fCstrftime(3)\fP to format dates in the
** $attribution string. Legal values are the strings your system
** accepts for the locale environment variable \fC$$$LC_TIME\fP.
** .pp
** This variable is to allow the attribution date format to be
** customized by recipient or folder using hooks. By default, Mutt
** will use your locale environment, so there is no need to set
** this except to override that default.
*/
{ "auto_tag", DT_BOOL, R_NONE, OPTAUTOTAG, 0 },
/*
** .pp
......@@ -599,8 +611,8 @@ struct option_t MuttVars[] = {
** function to process the date, see the man page for the proper syntax.
** .pp
** Unless the first character in the string is a bang (``!''), the month
** and week day names are expanded according to the locale specified in
** the variable $$locale. If the first character in the string is a
** and week day names are expanded according to the locale.
** If the first character in the string is a
** bang, the bang is discarded, and the month and week day names in the
** rest of the string are expanded in the \fIC\fP locale (that is in US
** English).
......
......@@ -401,7 +401,9 @@ void mutt_make_attribution (CONTEXT *ctx, HEADER *cur, FILE *out)
char buffer[LONG_STRING];
if (Attribution)
{
setlocale (LC_TIME, NONULL (AttributionLocale));
mutt_make_string (buffer, sizeof (buffer), Attribution, ctx, cur);
setlocale (LC_TIME, "");
fputs (buffer, out);
fputc ('\n', out);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment