summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0347901)
raw | patch | inline | side by side (parent: 0347901)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 5 Jan 2002 02:27:00 +0000 (02:27 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 5 Jan 2002 02:27:00 +0000 (02:27 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@499 57a73879-2fb5-44c3-a270-3262357dd7e2
I18N_PROGRESS.txt | patch | blob | history | |
roundup/date.py | patch | blob | history |
diff --git a/I18N_PROGRESS.txt b/I18N_PROGRESS.txt
index a664c53e658b06b22b5de4cbdaac78e36664ae6a..dad31c0bb25e078c74130287a985a8a5f206e967 100644 (file)
--- a/I18N_PROGRESS.txt
+++ b/I18N_PROGRESS.txt
THESE FILES DO NOT USE _()
==========================
-roundup/cgitb.py
-roundup/date.py
roundup/htmltemplate.py
roundup/hyperdb.py
roundup/i18n.py
roundup/__init__.py
roundup/cgi_client.py
roundup/admin.py
+roundup/cgitb.py
+roundup/date.py
WE DON'T CARE ABOUT THESE FILES
diff --git a/roundup/date.py b/roundup/date.py
index 8382ec3fd162c78d01189080c9c0489895b596a5..c74b85d6a6068a83659363e83f4757843beae078 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: date.py,v 1.14 2001-11-22 15:46:42 jhermann Exp $
+# $Id: date.py,v 1.15 2002-01-05 02:27:00 richard Exp $
__doc__ = """
Date, time and time interval handling.
'''
m = date_re.match(spec)
if not m:
- raise ValueError, 'Not a date spec: [[yyyy-]mm-dd].[[h]h:mm[:ss]] [offset]'
+ raise ValueError, _('Not a date spec: [[yyyy-]mm-dd].[[h]h:mm[:ss]]'
+ '[offset]')
info = m.groupdict()
# get the current date/time using the offset
self.sign = 1
m = interval_re.match(spec)
if not m:
- raise ValueError, 'Not an interval spec: [+-] [#y] [#m] [#w] [#d] [[[H]H:MM]:SS]'
+ raise ValueError, _('Not an interval spec: [+-] [#y] [#m] [#w] '
+ '[#d] [[[H]H:MM]:SS]')
info = m.groupdict()
for group, attr in {'y':'year', 'm':'month', 'w':'week', 'd':'day',
def __repr__(self):
return '<Interval %s>'%self.__str__()
- def pretty(self, threshold=('d', 5)):
+ def pretty(self):
''' print up the date date using one of these nice formats..
- < 1 minute
- < 15 minutes
- < 30 minutes
- < 1 hour
- < 12 hours
- < 1 day
- otherwise, return None (so a full date may be displayed)
'''
if self.year or self.month > 2:
return None
days = (self.month * 30) + self.day
if days > 28:
if int(days/30) > 1:
- return '%s months'%int(days/30)
+ return _('%(number)s months')%{'number': int(days/30)}
else:
- return '1 month'
+ return _('1 month')
else:
- return '%s weeks'%int(days/7)
+ return _('%(number)s weeks')%{'number': int(days/7)}
if self.day > 7:
- return '1 week'
+ return _('1 week')
if self.day > 1:
- return '%s days'%self.day
+ return _('%(number)s days')%{'number': self.day}
if self.day == 1 or self.hour > 12:
- return 'yesterday'
+ return _('yesterday')
if self.hour > 1:
- return '%s hours'%self.hour
+ return _('%(number)s hours')%{'number': self.hour}
if self.hour == 1:
if self.minute < 15:
- return 'an hour'
+ return _('an hour')
quart = self.minute/15
if quart == 2:
- return '1 1/2 hours'
- return '1 %s/4 hours'%quart
+ return _('1 1/2 hours')
+ return _('1 %(number)s/4 hours')%{'number': quart}
if self.minute < 1:
- return 'just now'
+ return _('just now')
if self.minute == 1:
- return '1 minute'
+ return _('1 minute')
if self.minute < 15:
- return '%s minutes'%self.minute
+ return _('%(number)s minutes')%{'number': self.minute}
quart = int(self.minute/15)
if quart == 2:
- return '1/2 an hour'
- return '%s/4 hour'%quart
+ return _('1/2 an hour')
+ return _('%(number)s/4 hour')%{'number': quart}
def get_tuple(self):
return (self.year, self.month, self.day, self.hour, self.minute,
#
# $Log: not supported by cvs2svn $
+# Revision 1.14 2001/11/22 15:46:42 jhermann
+# Added module docstrings to all modules.
+#
# Revision 1.13 2001/09/18 22:58:37 richard
#
# Added some more help to roundu-admin