diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f1854a4b9..505457ecf 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -2,6 +2,11 @@ * src/GenericFilter.py: Change filter rule names to make them consistent. * src/gramps_main.py: Change filter names to make them consistent. + * src/Date.py: Import gettext. + * src/DateDisplay.py: Import gettext. + * src/GenericFilter.py: Support existing custom_filters.xml files + by adding an old2new mapping for names. + 2005-05-17 Martin Hawlisch * src/plugins/ImportGeneWeb.py (decode): Decode characters and named entities. Because gramps is not web browser based we can simply use diff --git a/gramps2/src/Date.py b/gramps2/src/Date.py index ce2bf5cee..7bc6164ae 100644 --- a/gramps2/src/Date.py +++ b/gramps2/src/Date.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2004 Donald N. Allingham +# Copyright (C) 2000-2005 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ __author__ = "Donald N. Allingham" __version__ = "$Revision$" +from gettext import gettext as _ from Errors import DateError from CalSdn import * diff --git a/gramps2/src/DateDisplay.py b/gramps2/src/DateDisplay.py index 6ebdacaad..139617cc2 100644 --- a/gramps2/src/DateDisplay.py +++ b/gramps2/src/DateDisplay.py @@ -30,6 +30,7 @@ __version__ = "$Revision$" import Date import locale +from gettext import gettext as _ class DateDisplay: diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index 1eb619190..d7ad3e232 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -1270,7 +1270,7 @@ class HasBirth(Rule): self.date = None def name(self): - return 'People with the birth data' + return 'People with the birth data:' def description(self): return _("Matches people with birth data of a particular value") @@ -2238,6 +2238,54 @@ class GenericFilter: # Name to class mappings # #------------------------------------------------------------------------- +# This dict is mapping from old names to new names, so that the existing +# custom_filters.xml will continue working +old2new = { + "Is default person" : "Default person", + "Has the Id" : "People with Id:", + "Is bookmarked person" : "Bookmarked people", + "Has a name" : "People with the name:", + "Has the relationships" : "People with the relationships:", + "Has the death" : "People with the death data:", + "Has the birth" : "People with the birth data:", + "Is a descendant of" : "Descendants of ", + "Is a descendant family member of" : "Descendant family members of ", + "Is a descendant of filter match": "Descendants of match", + "Is a descendant of person not more than N generations away": + "Descendants of not more than generations away", + "Is an ancestor of person at least N generations away" : + "Ancestors of at least generations away", + "Is a child of filter match" : "Children of match", + "Is an ancestor of" : "Ancestors of ", + "Is an ancestor of filter match":"Ancestors of match", + "Is an ancestor of person not more than N generations away" : + "Ancestors of not more than generations away", + "Is an ancestor of person at least N generations away": + "Ancestors of at least generations away", + "Is a parent of filter match" : "Parents of match", + "Has a common ancestor with" : + "People with a common ancestor with ", + "Has a common ancestor with filter match" : + "People with a common ancestor with match", + "Is a female" : "Females", + "Is a male" : "Males", + "Has complete record" : "People with complete records", + "Has the personal event" : "People with the personal event:", + "Has the family event" : "People with the family event:", + "Has the personal attribute" : "People with the personal attribute:", + "Has the family attribute" : "People with the family attribute:", + "Has source of" : "People with the source:", + "Matches the filter named" : "People matching the ", + "Is spouse of filter match" : "Spouses of match", + "Is a sibling of filter match" : "Siblings of match", + "Relationship path between two people" : "Relationship path between ", + "Adopted people" : "People who were adopted", + "People who have images" : "People with images", + "People without a birth date" : "People without a known birth date", + "Families with incomplete events" :"People with incomplete events", + "Has text matching substring of" :"People with records containing the substring:", +} + tasks = { unicode(_("Everyone")) : Everyone, unicode(_("Default person")) : IsDefaultPerson, @@ -2246,7 +2294,7 @@ tasks = { unicode(_("People with the name:")) : HasNameOf, unicode(_("People with the relationships:")) : HasRelationship, unicode(_("People with the death data:")) : HasDeath, - unicode(_("People with the birth data")) : HasBirth, + unicode(_("People with the birth data:")) : HasBirth, unicode(_("Descendants of ")) : IsDescendantOf, unicode(_("Descendant family members of ")) : IsDescendantFamilyOf, unicode(_("Descendants of match")) : IsDescendantOfFilterMatch, @@ -2399,6 +2447,8 @@ class FilterParser(handler.ContentHandler): self.gfilter_list.add(self.f) elif tag == "rule": cname = attrs['class'] + if cname in old2new: + cname = old2new[cname] name = unicode(_(cname)) self.a = [] if name in tasks: