3485: A better message for date validator on AgeOnDate Gramplet.

svn: r13939
This commit is contained in:
Jérôme Rapinat 2009-12-29 16:56:27 +00:00
parent b53fda23cb
commit bbdf6d80cc
2 changed files with 7 additions and 6 deletions

View File

@ -1689,7 +1689,8 @@ def main(args):
def on_validate(widget, text): def on_validate(widget, text):
myDate = parser.parse(text) myDate = parser.parse(text)
if not myDate.is_regular(): if not myDate.is_regular():
return ValidationError("'%s' is not a valid date value") # used on AgeOnDateGramplet
return ValidationError(_("'%s' is not a valid date value"))
win = gtk.Window() win = gtk.Window()
win.set_title('ValidatableMaskedEntry test window') win.set_title('ValidatableMaskedEntry test window')

View File

@ -64,11 +64,11 @@ class AgeOnDateGramplet(Gramplet):
description.set_wrap_mode(gtk.WRAP_WORD) description.set_wrap_mode(gtk.WRAP_WORD)
description.set_editable(False) description.set_editable(False)
buffer = description.get_buffer() buffer = description.get_buffer()
buffer.set_text(_("Enter a date in the entry below and click Run." buffer.set_text(_("Enter a date (YYYY-MM-DD) in the entry below"
" This will compute the ages for everyone in your" " and click Run. This will compute the ages for"
" Family Tree on that date. You can then sort by" " everyone in your Family Tree on that date."
" the age column, and double-click the row to view" " You can then sort by the age column, and"
" or edit.")) " double-click the row to view or edit."))
label = gtk.Label() label = gtk.Label()
label.set_text(_("Date") + ":") label.set_text(_("Date") + ":")
self.entry = gtk.Entry() self.entry = gtk.Entry()