[asterisk-bugs] [Asterisk 0014333]: [patch] add option to configure locale for date/time string construction

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jan 26 17:18:41 CST 2009


The following issue requires your FEEDBACK. 
====================================================================== 
http://bugs.digium.com/view.php?id=14333 
====================================================================== 
Reported By:                klaus3000
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   14333
Category:                   Applications/app_voicemail/NewFeature
Reproducibility:            have not tried
Severity:                   feature
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 169203 
Request Review:              
====================================================================== 
Date Submitted:             2009-01-26 07:35 CST
Last Modified:              2009-01-26 17:18 CST
====================================================================== 
Summary:                    [patch] add option to configure locale for date/time
string construction
Description: 
Hi!

When voicemail sends emails it constructs the date/time when the
voicemessage was received. This patch allows to configure the locale for
generation of the string.

locale=de_AT.UTF-8 results in

"Montag, 26 Jänner 2009" instead of "Monday, 26 January 2009".

This could also be achieved setting the default OS locale - but this would
also change the locale of all other date/time strings in Asterisk
(logmesage, CDRs...) which can be bad.
====================================================================== 

---------------------------------------------------------------------- 
 (0098806) Corydon76 (administrator) - 2009-01-26 17:18
 http://bugs.digium.com/view.php?id=14333#c98806 
---------------------------------------------------------------------- 
Unfortunately, this is not going to work.  The problem is that setlocale(3)
does not work on a thread-level to influence only the thread's environment.
 Instead, it influences the entire program, so for the period that you are
using the alternative locale, all other messages (like log messages) will
also have the alternative locale.

HOWEVER, there is a new specification in one of the latest POSIX
specifications (IEEE Std 1003.1-2008), that has a thread-specific locale,
which is exactly what you want.  The API calls are newlocale(3),
uselocale(3), and freelocale(3).  You can view the specifications here: 
http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html  If
you update to these API calls, then this can be added. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-26 17:18 Corydon76      Note Added: 0098806                          
2009-01-26 17:18 Corydon76      Status                   confirmed => feedback
======================================================================




More information about the asterisk-bugs mailing list