diff --git a/src/AbiWordDoc.py b/src/AbiWordDoc.py index 6fd36ff82..38b4073b2 100644 --- a/src/AbiWordDoc.py +++ b/src/AbiWordDoc.py @@ -32,11 +32,12 @@ class AbiWordDoc(TextDoc): TextDoc.__init__(self,type,orientation) self.f = None self.level = 0 + self.new_page = 0 def open(self,filename): if filename[-4:] != ".abw": - self.filename = filename + ".abw" + self.filename = "%s.abw" % filename else: self.filename = filename @@ -104,6 +105,7 @@ class AbiWordDoc(TextDoc): def start_paragraph(self,style_name): style = self.style_list[style_name] + self.current_style = style self.f.write('

') font = style.get_font() @@ -126,7 +129,7 @@ class AbiWordDoc(TextDoc): self.f.write('Arial;') else: self.f.write('Times New Roman;') - self.f.write('font-size:' + str(font.get_size()) + 'pt') + self.f.write('font-size:%dpt' % font.get_size()) if font.get_bold(): self.f.write('; font-weight:bold') if font.get_italic(): @@ -135,15 +138,58 @@ class AbiWordDoc(TextDoc): if color != (0,0,0): self.f.write('; color:%2x%2x%2x' % color) if font.get_underline(): - self.f.write('; text-decoration:underline' % color) + self.f.write('; text-decoration:underline') self.f.write('">') + if self.new_page == 1: + self.new_page = 0 + self.f.write('') + def page_break(self,orientation=None): + self.new_page = 1 + def end_paragraph(self): self.f.write('

\n') def write_text(self,text): self.f.write(text) + def start_bold(self): + font = self.current_style.get_font() + self.f.write('') + + def end_bold(self): + font = self.current_style.get_font() + self.f.write('') + if __name__ == "__main__": paper = PaperStyle("Letter",27.94,21.59) diff --git a/src/EditPerson.py b/src/EditPerson.py index ec1439a2e..a56da524d 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -1023,7 +1023,7 @@ def on_apply_person_clicked(obj): if error == 1: msg = _("Changing the gender caused problems with marriage information.") - msg2 = _("Please check the person's marriage relationships") + msg2 = _("Please check the person's marriage relationships.") GnomeErrorDialog(msg + msg2) text = edit_person_obj.notes_field.get_chars(0,-1) diff --git a/src/Filter.py b/src/Filter.py index 76d6ace89..83c67ff91 100644 --- a/src/Filter.py +++ b/src/Filter.py @@ -18,13 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -#------------------------------------------------------------------------- -# -# Documentation String - used to describe the filter -# -#------------------------------------------------------------------------- -"All people" - #------------------------------------------------------------------------- # # Standard python modules @@ -33,6 +26,9 @@ import re import os import sys +import intl + +_ = intl.gettext #------------------------------------------------------------------------- # @@ -40,7 +36,6 @@ import sys # #------------------------------------------------------------------------- class Filter: - "All people" #------------------------------------------------------------------------- # @@ -106,9 +101,9 @@ def create(text): def need_qualifier(): return 0 -filterList = [ "All people" ] -filterMap = { "All people" : create } -filterEnb = { "All people" : need_qualifier } +filterList = [ _("All people") ] +filterMap = { _("All people") : create } +filterEnb = { _("All people") : need_qualifier } #------------------------------------------------------------------------- # @@ -135,9 +130,16 @@ def load_filters(dir): plugin = __import__(groups[0]) except: continue + + if "get_name" in plugin.__dict__.keys(): + name = plugin.get_name() + else: + name = plugin.__doc__ + for task in plugin.__dict__.keys(): if task == "create": - filterMap[plugin.__doc__] = plugin.__dict__[task] + filterMap[name] = plugin.__dict__[task] filterList.append(plugin.__doc__) if task == "need_qualifier" : - filterEnb[plugin.__doc__] = plugin.__dict__[task] + filterEnb[name] = plugin.__dict__[task] + diff --git a/src/GrampsParser.py b/src/GrampsParser.py index c04b1a7c9..84732b2cf 100644 --- a/src/GrampsParser.py +++ b/src/GrampsParser.py @@ -785,7 +785,6 @@ class GrampsParser(handler.ContentHandler): f(self,attrs) except: GrampsParser.func_map[tag] = (None,None) - print tag self.func = None #--------------------------------------------------------------------- diff --git a/src/OpenOfficeDoc.py b/src/OpenOfficeDoc.py index 9c0131229..f6acae7a6 100644 --- a/src/OpenOfficeDoc.py +++ b/src/OpenOfficeDoc.py @@ -40,6 +40,7 @@ class OpenOfficeDoc(TextDoc): self.filename = None self.level = 0 self.time = "0000-00-00T00:00:00" + self.new_page = 0 def open(self,filename): import time @@ -91,6 +92,15 @@ class OpenOfficeDoc(TextDoc): self.f.write('style:font-pitch="variable"/>\n') self.f.write('\n') self.f.write('\n') + for style_name in self.style_list.keys(): + style = self.style_list[style_name] + self.f.write('\n\n') + self.f.write('\n') for style_name in self.table_styles.keys(): style = self.table_styles[style_name] self.f.write('\n') self.f.write('\n') - self.f.write('\n') + self.f.write('\n') self.f.write('\n') self.f.write('\n') self.f.write('\n') @@ -206,6 +216,12 @@ class OpenOfficeDoc(TextDoc): for col in range(1,self.span): self.f.write('\n') + def start_bold(self): + self.f.write('') + + def end_bold(self): + self.f.write('') + def _write_zip(self): if os.path.isfile(self.filename): @@ -364,14 +380,23 @@ class OpenOfficeDoc(TextDoc): self.f.write('\n') self.f.write('\n') self.f.close() + + def page_break(self): + self.new_page = 1 def start_paragraph(self,style_name): style = self.style_list[style_name] self.level = style.get_header_level() + if self.new_page == 1: + self.new_page = 0 + name = "NL%s" % style_name + else: + name = style_name if self.level == 0: - self.f.write('') + self.f.write('' % name) else: - self.f.write('') def end_paragraph(self): diff --git a/src/TextDoc.py b/src/TextDoc.py index 21ad6f969..a11b03268 100644 --- a/src/TextDoc.py +++ b/src/TextDoc.py @@ -377,10 +377,13 @@ class TextDoc: def close(self): pass - def start_page(self,orientation=None): + def page_break(self): pass - def end_page(self): + def start_bold(self): + pass + + def end_bold(self): pass def start_paragraph(self,style_name): diff --git a/src/build_po b/src/build_po index b61c52c12..2aaddfb56 100755 --- a/src/build_po +++ b/src/build_po @@ -4,7 +4,6 @@ mv template.po template.po.bak echo "Working on the glade files" libglade-xgettext -c -o glade.c *.glade echo "Working on python files" -./get_strings *.py >> glade.c +./get_strings *.py filters/*.py >> glade.c echo "Building template.po" xgettext -C -s -a -o template.po glade.c -#rm glade.c diff --git a/src/const.py b/src/const.py index 6c2f972b8..9c8189489 100644 --- a/src/const.py +++ b/src/const.py @@ -67,7 +67,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc" # #------------------------------------------------------------------------- progName = "gramps" -version = "0.1.4" +version = "0.1.5pre" copyright = "(C) 2001 Donald N. Allingham" authors = ["Donald N. Allingham"] comments = _("Gramps (Genealogical Research and Analysis Management ") +\ diff --git a/src/filters/After.py b/src/filters/After.py index e4503077c..31a4682c5 100644 --- a/src/filters/After.py +++ b/src/filters/After.py @@ -24,6 +24,8 @@ import Filter import string import Date import RelLib +import intl +_ = intl.gettext #------------------------------------------------------------------------ # @@ -60,6 +62,14 @@ class EventAfter(Filter.Filter): break return val +#------------------------------------------------------------------------ +# +# +# +#------------------------------------------------------------------------ +def get_name(): + return _("People with an event after ...") + #------------------------------------------------------------------------ # # diff --git a/src/filters/Before.py b/src/filters/Before.py index e7996cb9d..7e8e1a12b 100644 --- a/src/filters/Before.py +++ b/src/filters/Before.py @@ -24,6 +24,8 @@ import Filter import string import Date import RelLib +import intl +_ = intl.gettext #------------------------------------------------------------------------ # @@ -76,3 +78,11 @@ def create(text): #------------------------------------------------------------------------ def need_qualifier(): return 1 + +#------------------------------------------------------------------------ +# +# +# +#------------------------------------------------------------------------ +def get_name(): + return _("People with an event before ...") diff --git a/src/filters/Disconnected.py b/src/filters/Disconnected.py index ef9f25a85..0ff3c9932 100644 --- a/src/filters/Disconnected.py +++ b/src/filters/Disconnected.py @@ -22,6 +22,8 @@ import Filter import RelLib +import intl +_ = intl.gettext class Disconnected(Filter.Filter): "Disconnected individuals" @@ -34,3 +36,6 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("Disconnected individuals") diff --git a/src/filters/EventPlace.py b/src/filters/EventPlace.py index 2e7062bdd..b5af35b9a 100644 --- a/src/filters/EventPlace.py +++ b/src/filters/EventPlace.py @@ -24,6 +24,8 @@ import Filter import string import re import RelLib +import intl +_ = intl.gettext class EventPlace(Filter.Filter): "People with an event location of ..." @@ -52,3 +54,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("People with an event location of ...") diff --git a/src/filters/EventType.py b/src/filters/EventType.py index e5d40d065..9ed8319a9 100644 --- a/src/filters/EventType.py +++ b/src/filters/EventType.py @@ -22,6 +22,8 @@ import Filter import string +import intl +_ = intl.gettext class EventType(Filter.Filter): "People who have photos" @@ -37,3 +39,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("People who have an event type of ...") diff --git a/src/filters/Females.py b/src/filters/Females.py index 5b6f664ef..a2f2d0b86 100644 --- a/src/filters/Females.py +++ b/src/filters/Females.py @@ -24,6 +24,8 @@ import Filter import string import utils from RelLib import Person +import intl +_ = intl.gettext class Females(Filter.Filter): "Females" @@ -37,3 +39,5 @@ def create(text): def need_qualifier(): return 0 +def get_name(): + return _("Females") diff --git a/src/filters/HavePhotos.py b/src/filters/HavePhotos.py index 8558b7fea..1fa71e695 100644 --- a/src/filters/HavePhotos.py +++ b/src/filters/HavePhotos.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class HavePhotos(Filter.Filter): "People who have photos" @@ -35,3 +37,6 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("People who have photos") diff --git a/src/filters/IncompleteNames.py b/src/filters/IncompleteNames.py index 0435e2329..0fcbff091 100644 --- a/src/filters/IncompleteNames.py +++ b/src/filters/IncompleteNames.py @@ -22,6 +22,8 @@ import Filter from RelLib import Person +import intl +_ = intl.gettext class IncompleteNames(Filter.Filter): "People with incomplete names" @@ -36,3 +38,5 @@ def create(text): def need_qualifier(): return 0 +def get_name(): + return _("People with incomplete names") diff --git a/src/filters/MatchSndEx.py b/src/filters/MatchSndEx.py index f5e7c5828..c7b4cce5a 100644 --- a/src/filters/MatchSndEx.py +++ b/src/filters/MatchSndEx.py @@ -23,6 +23,8 @@ import Filter import soundex import RelLib +import intl +_ = intl.gettext class MatchSndEx(Filter.Filter): "Names with same SoundEx code as ..." @@ -39,3 +41,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("Names with same SoundEx code as ...") diff --git a/src/filters/MatchSndEx2.py b/src/filters/MatchSndEx2.py index 5c47d0d88..67dcb429a 100644 --- a/src/filters/MatchSndEx2.py +++ b/src/filters/MatchSndEx2.py @@ -23,6 +23,8 @@ import Filter import soundex import RelLib +import intl +_ = intl.gettext class MatchSndEx2(Filter.Filter): "Names with the specified SoundEx code" @@ -35,3 +37,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("Names with the specified SoundEx code") diff --git a/src/filters/MutlipleMarriages.py b/src/filters/MutlipleMarriages.py index 51fe87ba9..33734bf22 100644 --- a/src/filters/MutlipleMarriages.py +++ b/src/filters/MutlipleMarriages.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class MultipleMarriages(Filter.Filter): "People with multiple marriage records" @@ -35,3 +37,6 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("People with multiple marriage records") diff --git a/src/filters/NeverMarried.py b/src/filters/NeverMarried.py index 95a216082..4c6b49296 100644 --- a/src/filters/NeverMarried.py +++ b/src/filters/NeverMarried.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class NeverMarried(Filter.Filter): "People with no marriage records" @@ -35,3 +37,6 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("People with no marriage records") diff --git a/src/filters/NoBirthdate.py b/src/filters/NoBirthdate.py index add9afcca..154e444c9 100644 --- a/src/filters/NoBirthdate.py +++ b/src/filters/NoBirthdate.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class NoBirthdate(Filter.Filter): "People no listed birth date" @@ -35,3 +37,8 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("People no listed birth date") + + diff --git a/src/filters/NoChildren.py b/src/filters/NoChildren.py index da24ceeca..04fe32171 100644 --- a/src/filters/NoChildren.py +++ b/src/filters/NoChildren.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class HaveChildren(Filter.Filter): "People with children" @@ -41,3 +43,6 @@ def create(text): def need_qualifier(): return 0 + +def get_name(): + return _("People with children") diff --git a/src/filters/RegExMatch.py b/src/filters/RegExMatch.py index 731cc0e31..eb68238a7 100644 --- a/src/filters/RegExMatch.py +++ b/src/filters/RegExMatch.py @@ -23,6 +23,8 @@ import Filter import re import utils +import intl +_ = intl.gettext class RegExMatch(Filter.Filter): "Names that match a regular expression" @@ -46,3 +48,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("Names that match a regular expression") diff --git a/src/filters/SubString.py b/src/filters/SubString.py index a5114ab2c..23eaff9fd 100644 --- a/src/filters/SubString.py +++ b/src/filters/SubString.py @@ -23,6 +23,8 @@ import Filter import string import utils +import intl +_ = intl.gettext class SubString(Filter.Filter): "Names that contain a substring" @@ -35,3 +37,6 @@ def create(text): def need_qualifier(): return 1 + +def get_name(): + return _("Names that contain a substring") diff --git a/src/plugins/AncestorChart.py b/src/plugins/AncestorChart.py index 491a08335..0d27f9315 100644 --- a/src/plugins/AncestorChart.py +++ b/src/plugins/AncestorChart.py @@ -36,6 +36,9 @@ from gtk import * from gnome.ui import * from libglade import * +import intl +_ = intl.gettext + #------------------------------------------------------------------------ # # @@ -198,7 +201,8 @@ def report(database,person): PaperMenu.make_paper_menu(topDialog.get_widget("papersize")) PaperMenu.make_orientation_menu(topDialog.get_widget("orientation")) - topDialog.get_widget("labelTitle").set_text("Ancestor chart for " + name) + title = _("Ancestor chart for %s") % name + topDialog.get_widget("labelTitle").set_text(title) topDialog.signal_autoconnect({ "destroy_passed_object" : utils.destroy_passed_object, "on_save_clicked" : on_save_clicked @@ -213,7 +217,7 @@ def on_save_clicked(obj): global active_person global db - outputName = topDialog.get_widget("filename").get_text() + outputName = topDialog.get_widget("fileentry1").get_full_path(0) if outputName == "": return @@ -240,7 +244,16 @@ def on_save_clicked(obj): # #------------------------------------------------------------------------ def get_description(): - return "Produces a graphical ancestral tree graph" + return _("Produces a graphical ancestral tree graph") + + +#------------------------------------------------------------------------ +# +# +# +#------------------------------------------------------------------------ +def get_name(): + return _("Generate files/Ancestor Chart") #------------------------------------------------------------------------ # diff --git a/src/plugins/AncestorGraph.py b/src/plugins/AncestorGraph.py index 2fbd39803..f00a01d9c 100644 --- a/src/plugins/AncestorGraph.py +++ b/src/plugins/AncestorGraph.py @@ -29,6 +29,9 @@ from gtk import * from gnome.ui import * from libglade import * +import intl +_ = intl.gettext + col2person = {} reportPerson = None zoom = 1.0 @@ -377,7 +380,10 @@ def mysort(first, second) : # #------------------------------------------------------------------------ def get_description(): - return "Produces a graphical ancestral tree graph" + return _("Produces a graphical ancestral tree graph") + +def get_name(): + return _("View/View an ancestor graph") #------------------------------------------------------------------------ # diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index 71270b903..68e9a50ac 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -27,6 +27,9 @@ import re import sort import string import utils +import intl + +_ = intl.gettext from TextDoc import * from OpenOfficeDoc import * @@ -53,35 +56,35 @@ db = None class AncestorReport: gen = { - 1 : "First", - 2 : "Second", - 3 : "Third", - 4 : "Fourth", - 5 : "Fifth", - 6 : "Sixth", - 7 : "Seventh", - 8 : "Eighth", - 9 : "Ninth", - 10: "Tenth", - 11: "Eleventh", - 12: "Twelfth", - 13: "Thirteenth", - 14: "Fourteenth", - 15: "Fifteenth", - 16: "Sixteenth", - 17: "Seventeenth", - 18: "Eigthteenth", - 19: "Nineteenth", - 20: "Twentieth", - 21: "Twenty-first", - 22: "Twenty-second", - 23: "Twenty-third", - 24: "Twenty-fourth", - 25: "Twenty-fifth", - 26: "Twenty-sixth", - 27: "Twenty-seventh", - 28: "Twenty-eighth", - 29: "Twenty-ninth" + 1 : _("First"), + 2 : _("Second"), + 3 : _("Third"), + 4 : _("Fourth"), + 5 : _("Fifth"), + 6 : _("Sixth"), + 7 : _("Seventh"), + 8 : _("Eighth"), + 9 : _("Ninth"), + 10: _("Tenth"), + 11: _("Eleventh"), + 12: _("Twelfth"), + 13: _("Thirteenth"), + 14: _("Fourteenth"), + 15: _("Fifteenth"), + 16: _("Sixteenth"), + 17: _("Seventeenth"), + 18: _("Eigthteenth"), + 19: _("Nineteenth"), + 20: _("Twentieth"), + 21: _("Twenty-first"), + 22: _("Twenty-second"), + 23: _("Twenty-third"), + 24: _("Twenty-fourth"), + 25: _("Twenty-fifth"), + 26: _("Twenty-sixth"), + 27: _("Twenty-seventh"), + 28: _("Twenty-eighth"), + 29: _("Twenty-ninth") } #-------------------------------------------------------------------- @@ -103,6 +106,8 @@ class AncestorReport: para = ParagraphStyle() para.set_font(font) para.set_header_level(1) + para.set_top_border(0.2) + para.set_bottom_border(0.2) self.doc.add_style("Title",para) font = FontStyle() @@ -113,6 +118,8 @@ class AncestorReport: para = ParagraphStyle() para.set_font(font) para.set_header_level(2) + para.set_top_border(0.15) + para.set_bottom_border(0.15) self.doc.add_style("Header",para) para = ParagraphStyle() @@ -122,7 +129,7 @@ class AncestorReport: try: self.doc.open(output) except IOError,msg: - GnomeErrorDialog("Could not open %s\n%s",msg) + GnomeErrorDialog(_("Could not open %s\n%s"),msg) #-------------------------------------------------------------------- # @@ -150,7 +157,8 @@ class AncestorReport: name = self.start.getPrimaryName().getRegularName() self.doc.start_paragraph("Title") - self.doc.write_text("Ahnentafel Chart for " + name) + title = _("Ahnentafel Chart for %s") % name + self.doc.write_text(title) self.doc.end_paragraph() keys = self.map.keys() @@ -160,8 +168,11 @@ class AncestorReport: for key in keys : if generation == 0 or key >= 2**generation: + if self.pgbrk and generation > 0: + self.doc.page_break() self.doc.start_paragraph("Header") - self.doc.write_text(AncestorReport.gen[generation+1 ]+ " Generation") + t = _("%s Generation") % AncestorReport.gen[generation+1] + self.doc.write_text(t) self.doc.end_paragraph() generation = generation + 1 @@ -169,7 +180,14 @@ class AncestorReport: person = self.map[key] name = person.getPrimaryName().getRegularName() - self.doc.write_text(str(key) + ".\t" + name ) + self.doc.write_text(str(key) + ".\t") + self.doc.start_bold() + self.doc.write_text(name) + self.doc.end_bold() + if name[-1:] == '.': + self.doc.write_text(" ") + else: + self.doc.write_text(". ") # Check birth record @@ -177,21 +195,25 @@ class AncestorReport: if birth: date = birth.getDateObj().get_start_date() place = birth.getPlace() + if place[-1:] == '.': + place = place[:-1] if date.getDate() != "" or place != "": - self.doc.write_text(" was born") if date.getDate() != "": if date.getDay() != -1 and date.getMonth() != -1: - self.doc.write_text(" on ") + if place != "": + t = _("%s was born on %s in %s. ") % \ + (name,date.getDate(),place) + else: + t = _("%s was born on %s. ") % \ + (name,date.getDate()) else: - self.doc.write_text(" in ") - self.doc.write_text(date.getDate()) - if place != "": - self.doc.write_text(" in " + place) - if place == "" or place[-1] != '.': - self.doc.write_text(".") - self.doc.write_text("\n") - else: - self.doc.write_text(".\n") + if place != "": + t = _("%s was born in %s in %s. ") % \ + (name,date.getDate(),place) + else: + t = _("%s was born in %s. ") % \ + (name,date.getDate()) + self.doc.write_text(t) death = person.getDeath() buried = None @@ -202,42 +224,71 @@ class AncestorReport: if death: date = death.getDateObj().get_start_date() place = death.getPlace() + if place[-1:] == '.': + place = place[:-1] if date.getDate() != "" or place != "": if person.getGender() == RelLib.Person.male: - self.doc.write_text("He") + male = 1 else: - self.doc.write_text("She") - self.doc.write_text(" died") + male = 0 if date.getDate() != "": if date.getDay() != -1 and date.getMonth() != -1: - self.doc.write_text(" on ") + if male: + if place != "": + t = _("He died on %s in %s") % \ + (date.getDate(),place) + else: + t = _("He died on %s") % date.getDate() + else: + if place != "": + t = _("She died on %s in %s") % \ + (date.getDate(),place) + else: + t = _("She died on %s") % date.getDate() else: - self.doc.write_text(" in ") - self.doc.write_text(date.getDate()) - if place != "": - self.doc.write_text(" in " + place) + if male: + if place != "": + t = _("He died in %s in %s") % \ + (date.getDate(),place) + else: + t = _("He died in %s") % date.getDate() + else: + if place != "": + t = _("She died in %s in %s") % \ + (date.getDate(),place) + else: + t = _("She died in %s") % date.getDate() + + self.doc.write_text(t) + if buried: date = buried.getDateObj().get_start_date() place = buried.getPlace() + if place[-1:] == '.': + place = place[:-1] if date.getDate() != "" or place != "": - self.doc.write_text(", and was buried") - if date.getDate() != "": if date.getDay() != -1 and date.getMonth() != -1: - self.doc.write_text(" on ") + if place != "": + t = _(", and was buried on %s in %s.") % \ + (date.getDate(),place) + else: + t = _(", and was buried on %s.") % \ + date.getDate() else: - self.doc.write_text(" in ") - self.doc.write_text(date.getDate()) - if place != "": - self.doc.write_text(" in " + place) - - if place == "" or place[-1] != '.': + if place != "": + t = _(", and was buried in %s in %s.") % \ + (date.getDate(),place) + else: + t = _(", and was buried in %s.") % \ + date.getDate() + else: + t = _(" and was buried in %s." % place) + self.doc.write_text(t) + else: self.doc.write_text(".") - self.doc.write_text("\n") - else: - self.doc.write_text(".\n") - + self.doc.end_paragraph() self.doc.close() @@ -301,7 +352,10 @@ def on_save_clicked(obj): global active_person global db - outputName = topDialog.get_widget("filename").get_text() + outputName = topDialog.get_widget("fileentry1").get_full_path(0) + if outputName == "": + return + max_gen = topDialog.get_widget("generations").get_value_as_int() pgbrk = topDialog.get_widget("pagebreak").get_active() template = topDialog.get_widget("htmltemplate").get_full_path(0) @@ -310,9 +364,6 @@ def on_save_clicked(obj): orien_obj = topDialog.get_widget("orientation").get_menu().get_active() orien = orien_obj.get_data("i") - if outputName == "": - return - if topDialog.get_widget("openoffice").get_active(): document = OpenOfficeDoc(paper,orien) elif topDialog.get_widget("abiword").get_active(): @@ -332,7 +383,10 @@ def on_save_clicked(obj): # #------------------------------------------------------------------------ def get_description(): - return "Produces a textual ancestral report" + return _("Produces a textual ancestral report") + +def get_name(): + return _("Generate files/Ahnentafel Chart") #------------------------------------------------------------------------ # diff --git a/src/plugins/ChangeTypes.py b/src/plugins/ChangeTypes.py index d5445f502..3e5536806 100644 --- a/src/plugins/ChangeTypes.py +++ b/src/plugins/ChangeTypes.py @@ -29,6 +29,9 @@ from libglade import * import RelLib import const import utils +import intl + +_ = intl.gettext topDialog = None @@ -90,5 +93,7 @@ def runTool(database,person,callback): # #------------------------------------------------------------------------- def get_description(): - return "Allows all the events of a certain name to be renamed to a new name" + return _("Allows all the events of a certain name to be renamed to a new name") +def get_name(): + return _("Database Processing/Rename personal event types") diff --git a/src/plugins/Check.py b/src/plugins/Check.py index f84743750..77745b629 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -24,6 +24,8 @@ import RelLib import utils import soundex import Config +import intl +_ = intl.gettext import string import os @@ -136,26 +138,26 @@ class CheckIntegrity: errors = blink + efam + pphotos + fphotos if errors == 0: - GnomeOkDialog("No errors were found") + GnomeOkDialog(_("No errors were found")) return text = "" if blink == 1: - text = text + "1 broken family link was found\n" + text = text + _("1 broken family link was found\n") elif blink > 1: - text = text + "%d broken family links were found\n" % blink + text = text + _("%d broken family links were found\n") % blink if efam == 1: - text = text + "1 empty family was found\n" + text = text + _("1 empty family was found\n") elif efam > 1: - text = text + "%d empty families were found\n" % efam + text = text + _("%d empty families were found\n") % efam if fphotos == 1: - text = text + "1 broken family photo was found\n" + text = text + _("1 broken family photo was found\n") elif fphotos > 1: - text = text + "%d broken family photos were found\n" % fphotos + text = text + _("%d broken family photos were found\n") % fphotos if pphotos == 1: - text = text + "1 broken personal photo was found\n" + text = text + _("1 broken personal photo was found\n") elif pphotos > 1: - text = text + "%d broken personal photos were found\n" % pphotos + text = text + _("%d broken personal photos were found\n") % pphotos GnomeWarningDialog(string.strip(text)) @@ -165,5 +167,7 @@ class CheckIntegrity: # #------------------------------------------------------------------------- def get_description(): - return "Checks the database for any relationship errors" + return _("Checks the database for any relationship errors") +def get_name(): + return _("Database Processing/Check database integrity") diff --git a/src/plugins/DescendReport.py b/src/plugins/DescendReport.py index 39051591a..f8739f620 100644 --- a/src/plugins/DescendReport.py +++ b/src/plugins/DescendReport.py @@ -172,7 +172,7 @@ def on_save_clicked(obj): myobj = obj.get_data("o") db = obj.get_data("d") - file = myobj.top.get_widget("filename").get_text() + file = myobj.top.get_widget("fileentry1").get_full_path(0) if file == "": return diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index ad827b1cc..b88eef1f6 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -435,7 +435,7 @@ def on_save_clicked(obj): global active_person global db - outputName = topDialog.get_widget("filename").get_text() + outputName = topDialog.get_widget("fileentry1").get_full_path(0) if outputName == "": return diff --git a/src/plugins/HtmlReport.py b/src/plugins/HtmlReport.py index dd97525f9..1fd0b1ead 100644 --- a/src/plugins/HtmlReport.py +++ b/src/plugins/HtmlReport.py @@ -242,8 +242,8 @@ def on_ok_clicked(obj): global restrict global no_photos - start = re.compile(r"") - stop = re.compile(r"") + start = re.compile(r"") + stop = re.compile(r"") top = [] bottom = [] diff --git a/src/plugins/IndivSummary.py b/src/plugins/IndivSummary.py index 326dfd76b..085789f1e 100644 --- a/src/plugins/IndivSummary.py +++ b/src/plugins/IndivSummary.py @@ -394,7 +394,7 @@ def on_save_clicked(obj): global active_person global db - outputName = topDialog.get_widget("filename").get_text() + outputName = topDialog.get_widget("fileentry1").get_full_path(0) if outputName == "": return