* src/DisplayModels.py (column_change): Use localized time string.

* src/PeopleModel.py (column_change): Use localized time string.
* src/RelLib.py (get_change_display): Use localized time string.


svn: r4526
This commit is contained in:
Alex Roitman
2005-05-10 03:34:50 +00:00
parent 0ba4449318
commit f4d716f280
4 changed files with 44 additions and 7 deletions

View File

@@ -17,6 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
@@ -25,6 +26,7 @@
#-------------------------------------------------------------------------
import time
from gettext import gettext as _
import locale
#-------------------------------------------------------------------------
#
@@ -44,6 +46,14 @@ import DateHandler
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
#-------------------------------------------------------------------------
#
# Localized constants
#
#-------------------------------------------------------------------------
_date_format = locale.nl_langinfo(locale.D_T_FMT)
_codeset = locale.nl_langinfo(locale.CODESET)
#-------------------------------------------------------------------------
#
# BaseModel
@@ -281,7 +291,8 @@ class SourceModel(BaseModel):
return unicode(data[4])
def column_change(self,data):
return unicode(time.asctime(time.localtime(data[8])))
return unicode(time.strftime(_date_format,time.localtime(data[8])),
_codeset)
#-------------------------------------------------------------------------
#
@@ -364,7 +375,8 @@ class PlaceModel(BaseModel):
return u''
def column_change(self,data):
return unicode(time.asctime(time.localtime(data[11])))
return unicode(time.strftime(_date_format,time.localtime(data[11])),
_codeset)
#-------------------------------------------------------------------------
#
@@ -423,4 +435,5 @@ class MediaModel(BaseModel):
return unicode(data[0])
def column_change(self,data):
return unicode(time.asctime(time.localtime(data[8])))
return unicode(time.strftime(_date_format,time.localtime(data[8])),
_codeset)