diff --git a/gramps/src/Date.py b/gramps/src/Date.py index 7883a1775..10ee944dd 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -35,7 +35,6 @@ class Date: formatCode = 0 entryCode = 0 - BadFormat = _("Unknown Format") Error = _("Illegal Date") range = 1 @@ -231,7 +230,7 @@ class SingleDate: _("before") + '|' + \ _("after") + '|' + \ _("aft") + '|' + \ - _("bef") + ")" + _("bef") + ')' start = "^\s*" + modifiers + "?\s*" diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index de00afad4..2d1d7bdc9 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -1905,7 +1905,7 @@ GtkLabel label142 - + GTK_JUSTIFY_CENTER False 1 diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index a56da524d..1698db82f 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -734,12 +734,7 @@ def on_event_add_clicked(obj): desc = edit_person_obj.event_descr_field.get_text() event = Event() - try: - event.set(name,date,place,desc) - except Date.BadFormat,msg: - msg1 = _(" is not a valid date format, and has been\n") - msg2 = _("ignored as the date of the event.") - GnomeWarningDialog(str(msg) + msg1) + event.set(name,date,place,desc) if name not in const.personalEvents: const.personalEvents.append(name) diff --git a/gramps/src/HtmlDoc.py b/gramps/src/HtmlDoc.py index 0304970ef..63e93d3a4 100644 --- a/gramps/src/HtmlDoc.py +++ b/gramps/src/HtmlDoc.py @@ -87,20 +87,22 @@ class HtmlDoc(TextDoc): self.bottom.append(line) templateFile.close() if top_add == 1: - mymsg = "Did not file '' marker in the template" + mymsg = _("The marker '' was not in the template") gnome.ui.GnomeErrorDialog(mymsg) except IOError,msg: import gnome.ui - mymsg = "Could not open the template file\n" + str(msg) + "\n" +\ - "Using default template" + mymsg = _("Could not open %s\nUsing the default template") % \ + self.template + mymsg = "%s\n%s" % (mymsg,msg) gnome.ui.GnomeWarningDialog(mymsg) self.bottom = _bottom self.top = _top except: import gnome.ui - mymsg = "Could not open the template file\n" + "Using default template" + mymsg = _("Could not open %s\nUsing the default template") % \ + self.template gnome.ui.GnomeWarningDialog(mymsg) self.bottom = _bottom self.top = _top @@ -196,7 +198,7 @@ class HtmlDoc(TextDoc): def start_cell(self,style_name,span=1): self.empty = 1 - self.f.write(' 1: self.f.write(' colspan="' + str(span) + '"') else: @@ -223,6 +225,6 @@ class HtmlDoc(TextDoc): def write_text(self,text): if text != "": self.empty = 0 - text = string.replace(text,'\n','
>') + text = string.replace(text,'\n','
') self.f.write(text) diff --git a/gramps/src/Plugins.py b/gramps/src/Plugins.py index bf7ba37f2..be0f28542 100644 --- a/gramps/src/Plugins.py +++ b/gramps/src/Plugins.py @@ -34,6 +34,8 @@ import intl _ = intl.gettext +names = {} + #------------------------------------------------------------------------- # # @@ -87,9 +89,14 @@ class ReportPlugins: item_hash = {} for report in reports: - info = string.split(report.__doc__,"/") + if report.__dict__.has_key("get_name"): + doc = report.get_name() + else: + doc = report.__doc__ + + info = string.split(doc,"/") if len(info) == 1: - category = "Uncategorized" + category = _("Uncategorized") name = info[0] else: category = info[0] @@ -105,7 +112,7 @@ class ReportPlugins: item.set_data("i",report.get_xpm_image) else: item.set_data("i",no_image) - item.set_data("t",report.__doc__) + item.set_data("t",doc) item.connect("select",on_report_node_selected) if item_hash.has_key(category): item_hash[category].append(item) @@ -151,12 +158,17 @@ class ToolPlugins: item_hash = {} for report in tools: - info = string.split(report.__doc__,"/") + if report.__dict__.has_key("get_name"): + doc = report.get_name() + else: + doc = report.__doc__ + + info = string.split(doc,"/") item = GtkTreeItem(info[1]) item.set_data("o",self) item.set_data("c",report.runTool) item.set_data("d",report.get_description) - item.set_data("t",report.__doc__) + item.set_data("t",doc) item.connect("select",on_node_selected) if item_hash.has_key(info[0]): item_hash[info[0]].append(item) @@ -221,7 +233,7 @@ def on_report_node_selected(obj): # #------------------------------------------------------------------------- def by_doc(a,b): - return cmp(a.__doc__,b.__doc__) + return cmp(names[a],names[b]) #------------------------------------------------------------------------- # @@ -281,8 +293,14 @@ def load_plugins(dir): groups = match.groups() try: plugin = __import__(groups[0]) + try: + names[plugin] = plugin.get_name() + except: + names[plugin] = plugin.__doc__ except: - print groups[0] + print _("Failed to load the module: %s") % groups[0] + import traceback + traceback.print_exc() continue for task in plugin.__dict__.keys(): if task == "report": @@ -308,7 +326,12 @@ def export_menu(callback): myMenu = GtkMenu() for report in exports: - item = GtkMenuItem(report.__doc__) + try: + text = report.get_name() + except: + text = report.__doc__ + item = GtkMenuItem(text) + item.show() item.connect("activate", callback ,report.writeData) myMenu.append(item) @@ -323,7 +346,12 @@ def import_menu(callback): myMenu = GtkMenu() for report in imports: - item = GtkMenuItem(report.__doc__) + try: + text = report.get_name() + except: + text = report.__doc__ + item = GtkMenuItem(text) + item.show() item.connect("activate", callback ,report.readData) myMenu.append(item) diff --git a/gramps/src/ReadXML.py b/gramps/src/ReadXML.py index 3cb8e08b3..2fd37b509 100644 --- a/gramps/src/ReadXML.py +++ b/gramps/src/ReadXML.py @@ -101,10 +101,10 @@ def loadData(database, filename, callback): else: xml_file = EncodedFile(gzip.open(filename,"rb"),'utf-8','latin-1') except IOError,msg: - GnomeErrorDialog(filename + _(" could not be opened\n") + str(msg)) + GnomeErrorDialog(_("%s could not be opened\n") % filename + str(msg)) return 0 except: - GnomeErrorDialog(filename + _(" could not be opened\n")) + GnomeErrorDialog(_("%s could not be opened\n") % filename) return 0 try: @@ -113,14 +113,13 @@ def loadData(database, filename, callback): else: parser.parse(xml_file) except xml.sax.SAXParseException: - GnomeErrorDialog(filename + _(" is a corrupt file")) + GnomeErrorDialog(_("%s is a corrupt file") % filename) return 0 except IOError,msg: - GnomeErrorDialog(filename + _(" is not a valid gramps file\n") + \ - str(msg)) + GnomeErrorDialog(_("Error reading %s") % filename + "\n" + str(msg)) return 0 except: - GnomeErrorDialog(_("Could not read ") + filename) + GnomeErrorDialog(_("Error reading %s") % filename) return 0 diff --git a/gramps/src/build_po b/gramps/src/build_po index 2aaddfb56..713d59271 100755 --- a/gramps/src/build_po +++ b/gramps/src/build_po @@ -1,9 +1,10 @@ #! /bin/sh +rm -f glade.c mv template.po template.po.bak echo "Working on the glade files" -libglade-xgettext -c -o glade.c *.glade +libglade-xgettext -c -o glade.c *.glade plugins/*.glade echo "Working on python files" -./get_strings *.py filters/*.py >> glade.c +./get_strings *.py plugins/*.py filters/*.py >> glade.c echo "Building template.po" xgettext -C -s -a -o template.po glade.c diff --git a/gramps/src/gramps.py b/gramps/src/gramps.py index ba2d6344c..13ba70dcc 100755 --- a/gramps/src/gramps.py +++ b/gramps/src/gramps.py @@ -1,9 +1,11 @@ #! /usr/bin/python -O +import traceback import intl import os intl.textdomain("gramps") +_ = intl.gettext if os.environ.has_key("GRAMPSI18N"): locale = os.environ["GRAMPSI18N"] @@ -15,7 +17,20 @@ intl.bindtextdomain("gramps",locale) import gramps_main import sys -if len(sys.argv) > 1: - gramps_main.main(sys.argv[1]) -else: - gramps_main.main(None) +try: + if len(sys.argv) > 1: + gramps_main.main(sys.argv[1]) + else: + gramps_main.main(None) +except: + + fname = os.path.expanduser("~/gramps.err") + errfile = open(fname,"w") + traceback.print_exc(file=errfile) + errfile.close() + + import gnome.ui + + msg1 = _("gramps has encountered an internal error.") + msg2 = _("The error log has been saved to %s.") % fname + gnome.ui.GnomeWarningDialog("%s\n%s" % (msg1,msg2)) diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 5138603e8..0f24b7ea6 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -640,26 +640,19 @@ def read_file(filename): if base == const.indexFile: filename = os.path.dirname(filename) elif not os.path.isdir(filename): - displayError(filename + _(" is not a directory")) + displayError(_("%s is not a directory") % filename) return - statusbar.set_status(_("Loading ") +\ - filename + "...") + statusbar.set_status(_("Loading %s ...") % filename) - if load_database(filename) == 1: - topWindow.set_title("Gramps - " + filename) - else: - statusbar.set_status("") - Config.save_last_file("") - -# try: -# if load_database(filename) == 1: -# topWindow.set_title("Gramps - " + filename) -# else: -# statusbar.set_status("") -# Config.save_last_file("") -# except: -# displayError(_("Failure reading ") + filename) + try: + if load_database(filename) == 1: + topWindow.set_title("%s - %s" % (_("Gramps"),filename)) + else: + statusbar.set_status("") + Config.save_last_file("") + except: + displayError(_("Failure reading %s") % filename) statusbar.set_progress(0.0) @@ -683,31 +676,27 @@ def on_ok_button2_clicked(obj): #------------------------------------------------------------------------- def save_file(filename): import WriteXML + + filename = os.path.normpath(filename) if sbar_active: - statusbar.set_status(_("Saving ") \ - + filename + "...") + statusbar.set_status(_("Saving %s ...") % filename) if os.path.exists(filename): if os.path.isdir(filename) == 0: - displayError(filename + _(" is not a directory")) + displayError(_("%s is not a directory") % filename) return else: try: os.mkdir(filename) except IOError, msg: - GnomeErrorDialog(_("Could not create ") + \ - os.path.normpath(filename) +\ - "\n" + str(msg)) + GnomeErrorDialog(_("Could not create %s") % filename + "\n" + str(msg)) return except OSError, msg: - GnomeErrorDialog(_("Could not create ") + \ - os.path.normpath(filename) +\ - "\n" + str(msg)) + GnomeErrorDialog(_("Could not create %s") % filename + "\n" + str(msg)) return except: - GnomeErrorDialog(_("Could not create ") + \ - os.path.normpath(filename)) + GnomeErrorDialog(_("Could not create %s") % filename) return old_file = filename @@ -1906,8 +1895,8 @@ def on_edit_bookmarks_activate(obj): def on_default_person_activate(obj): if active_person: name = active_person.getPrimaryName().getRegularName() - topWindow.question(_("Do you wish to set ") + name + \ - _(" as the home person?"), set_person) + topWindow.question(_("Do you wish to set %s as the home person") % name, \ + set_person) #------------------------------------------------------------------------- # diff --git a/gramps/src/plugins/AncestorChart.py b/gramps/src/plugins/AncestorChart.py index 0d27f9315..9daef11de 100644 --- a/gramps/src/plugins/AncestorChart.py +++ b/gramps/src/plugins/AncestorChart.py @@ -31,6 +31,11 @@ import utils from TextDoc import * from DrawDoc import * from OpenDrawDoc import * +try: + from PdfDrawDoc import * + no_pdf = 0 +except: + no_pdf = 1 from gtk import * from gnome.ui import * @@ -162,6 +167,7 @@ class AncestorChart: name = name + "\nd. " + death.getDate() self.doc.draw_box("box",name,self.x[level],self.y[index-1]) + if index > 1: old_index = int(index/2)-1 x1 = self.x[level-1]+(self.width/2.0) @@ -170,6 +176,7 @@ class AncestorChart: y1 = self.y[old_index]+self.height else: y1 = self.y[old_index] + y2 = self.y[index-1]+(self.height/2.0) self.doc.draw_line("line",x1,y1,x1,y2) self.doc.draw_line("line",x1,y2,x2,y2) @@ -201,6 +208,9 @@ def report(database,person): PaperMenu.make_paper_menu(topDialog.get_widget("papersize")) PaperMenu.make_orientation_menu(topDialog.get_widget("orientation")) + if no_pdf == 1: + topDialog.get_widget("pdf").set_sensitive(0) + title = _("Ancestor chart for %s") % name topDialog.get_widget("labelTitle").set_text(title) topDialog.signal_autoconnect({ @@ -228,9 +238,12 @@ def on_save_clicked(obj): max_gen = topDialog.get_widget("generations").get_value_as_int() - document = OpenDrawDoc(paper,orien) + if topDialog.get_widget("openoffice").get_active(): + document = OpenDrawDoc(paper,orien) + else: + document = PdfDrawDoc(paper,orien) - MyReport = AncestorChart(db,active_person,outputName,document, max_gen) + MyReport = AncestorChart(db,active_person,outputName,document,max_gen) MyReport.setup() MyReport.write_report() diff --git a/gramps/src/plugins/AncestorReport.py b/gramps/src/plugins/AncestorReport.py index 68e9a50ac..0b1d8e11b 100644 --- a/gramps/src/plugins/AncestorReport.py +++ b/gramps/src/plugins/AncestorReport.py @@ -36,6 +36,12 @@ from OpenOfficeDoc import * from HtmlDoc import * from AbiWordDoc import * +try: + from PdfDoc import * + no_pdf = 0 +except: + no_pdf = 1 + from gtk import * from gnome.ui import * from libglade import * @@ -129,7 +135,7 @@ class AncestorReport: try: self.doc.open(output) except IOError,msg: - GnomeErrorDialog(_("Could not open %s\n%s"),msg) + GnomeErrorDialog(_("Could not open %s") % output + "\n" + msg) #-------------------------------------------------------------------- # @@ -320,6 +326,9 @@ def report(database,person): PaperMenu.make_paper_menu(topDialog.get_widget("papersize")) PaperMenu.make_orientation_menu(topDialog.get_widget("orientation")) + if no_pdf: + topDialog.get_widget("pdf").set_sensitive(0) + topDialog.get_widget("labelTitle").set_text("Ahnentafel Report for " + name) topDialog.signal_autoconnect({ "destroy_passed_object" : utils.destroy_passed_object, @@ -368,6 +377,8 @@ def on_save_clicked(obj): document = OpenOfficeDoc(paper,orien) elif topDialog.get_widget("abiword").get_active(): document = AbiWordDoc(paper,orien) + elif topDialog.get_widget("pdf").get_active(): + document = PdfDoc(paper,orien) else: document = HtmlDoc(template) diff --git a/gramps/src/plugins/Desbrowser.py b/gramps/src/plugins/Desbrowser.py index e32235401..a7c4462ff 100644 --- a/gramps/src/plugins/Desbrowser.py +++ b/gramps/src/plugins/Desbrowser.py @@ -25,6 +25,9 @@ import re import string import os import utils +import intl + +_ = intl.gettext from gtk import * from gnome.ui import * @@ -75,12 +78,20 @@ def add_to_tree(tree,person): subtree.show() item.set_subtree(subtree) add_to_tree(subtree,child) - + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def get_name(): + return _("Analysis and Exploration/Interactive descendant browser") + #------------------------------------------------------------------------- # # # #------------------------------------------------------------------------- def get_description(): - return "Provides a browsable hierarchy of the active person" + return _("Provides a browsable hierarchy of the active person") diff --git a/gramps/src/plugins/DescendReport.py b/gramps/src/plugins/DescendReport.py index f8739f620..f4e4026a5 100644 --- a/gramps/src/plugins/DescendReport.py +++ b/gramps/src/plugins/DescendReport.py @@ -24,6 +24,9 @@ import os import re import sort import string +import intl + +_ = intl.gettext import RelLib import const @@ -33,6 +36,12 @@ from TextDoc import * from OpenOfficeDoc import * from AbiWordDoc import * from HtmlDoc import * +try: + import reportlab.platypus.tables + from PdfDoc import * + no_pdf = 0 +except: + no_pdf = 1 from gtk import * from gnome.ui import * @@ -96,8 +105,9 @@ class DescendantReport: #-------------------------------------------------------------------- def report(self): self.doc.start_paragraph("Title") - self.doc.write_text('Descendants of ') - self.doc.write_text(self.person.getPrimaryName().getRegularName()) + name = self.person.getPrimaryName().getRegularName() + self.doc.write_text(_("Descendants of %s") % name) + self.doc.write_text() self.doc.end_paragraph() self.dump(1,self.person) @@ -151,6 +161,10 @@ class DesReportWindow: PaperMenu.make_orientation_menu(self.top.get_widget("orientation")) mytop = self.top.get_widget("dialog1") + + if no_pdf: + self.top.get_widget("pdf").set_sensitive(0) + mytop.set_data("o",self) mytop.set_data("d",db) mytop.show() @@ -187,7 +201,7 @@ def on_save_clicked(obj): elif myobj.top.get_widget("abiword").get_active(): document = AbiWordDoc(paper,orien) else: - return + document = PdfDoc(paper,orien) report = DescendantReport(file,myobj.person,db,document) report.setup() @@ -218,8 +232,11 @@ def on_html_toggled(obj): # #------------------------------------------------------------------------ def get_description(): - return "Generates a list of descendants of the active person" - + return _("Generates a list of descendants of the active person") + +def get_name(): + return _("Generate files/Descendant Report") + #------------------------------------------------------------------------ # # diff --git a/gramps/src/plugins/EventCmp.py b/gramps/src/plugins/EventCmp.py index ec7ca8cb1..a4a20a9e4 100644 --- a/gramps/src/plugins/EventCmp.py +++ b/gramps/src/plugins/EventCmp.py @@ -30,6 +30,9 @@ import re import sort import utils import string +import intl + +_ = intl.gettext #------------------------------------------------------------------------ # @@ -450,10 +453,10 @@ def runTool(database,person,callback): # #------------------------------------------------------------------------- def get_description(): - return "Genealogical Research Event Analysis Tool\n\n" \ - "Aids in the analysis of data by allowing the development "\ - "of custom filters that can be applied to the database to "\ - "find similar events" + return _("Aids in the analysis of data by allowing the development of custom filters that can be applied to the database to find similar events") + +def get_name(): + return _("Analysis and Exploration/Compare individual events") #------------------------------------------------------------------------- # diff --git a/gramps/src/plugins/FamilyGroup.py b/gramps/src/plugins/FamilyGroup.py index b88eef1f6..228b4cc19 100644 --- a/gramps/src/plugins/FamilyGroup.py +++ b/gramps/src/plugins/FamilyGroup.py @@ -27,10 +27,19 @@ import re import sort import string import utils +import intl + +_ = intl.gettext from TextDoc import * from OpenOfficeDoc import * from HtmlDoc import * +try: + import reportlab.platypus.tables + from PdfDoc import * + no_pdf = 0 +except: + no_pdf = 1 from gtk import * from gnome.ui import * @@ -157,7 +166,7 @@ class FamilyGroup: def setup(self): self.doc.open(self.output) self.doc.start_paragraph('Title') - self.doc.write_text("Family Group Record") + self.doc.write_text(_("Family Group Record")) self.doc.end_paragraph() def end(self): @@ -186,7 +195,7 @@ class FamilyGroup: self.doc.start_row() self.doc.start_cell("TextContents") self.doc.start_paragraph('Normal') - self.doc.write_text("Birth") + self.doc.write_text(_("Birth")) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell("TextContents") @@ -204,7 +213,7 @@ class FamilyGroup: self.doc.start_row() self.doc.start_cell("TextContents") self.doc.start_paragraph('Normal') - self.doc.write_text("Death") + self.doc.write_text(_("Death")) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell("TextContents") @@ -232,7 +241,7 @@ class FamilyGroup: self.doc.start_row() self.doc.start_cell("TextContents") self.doc.start_paragraph('Normal') - self.doc.write_text("Father") + self.doc.write_text(_("Father")) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell("TextContentsEnd",2) @@ -245,7 +254,7 @@ class FamilyGroup: self.doc.start_row() self.doc.start_cell("TextContents") self.doc.start_paragraph('Normal') - self.doc.write_text("Mother") + self.doc.write_text(_("Mother")) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell("TextContentsEnd",2) @@ -258,6 +267,12 @@ class FamilyGroup: self.doc.end_table() def dump_child_event(self,text,name,event): + if event: + date = event.getDate() + place = event.getPlace() + else: + date = "" + place = "" self.doc.start_row() self.doc.start_cell(text) self.doc.start_paragraph('Normal') @@ -270,12 +285,12 @@ class FamilyGroup: self.doc.end_cell() self.doc.start_cell('TextContents') self.doc.start_paragraph('Normal') - self.doc.write_text(event.getDate()) + self.doc.write_text(date) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell('TextContentsEnd') self.doc.start_paragraph('Normal') - self.doc.write_text(event.getPlace()) + self.doc.write_text(place) self.doc.end_paragraph() self.doc.end_cell() self.doc.end_row() @@ -307,6 +322,7 @@ class FamilyGroup: index = 1 for family in person.getFamilyList(): + m = family.getMarriage() if person == family.getFather(): spouse =family.getMother() else: @@ -318,7 +334,7 @@ class FamilyGroup: self.doc.end_cell() self.doc.start_cell('TextContents') self.doc.start_paragraph('Normal') - self.doc.write_text("Spouse") + self.doc.write_text(_("Spouse")) self.doc.end_paragraph() self.doc.end_cell() self.doc.start_cell('TextContentsEnd',2) @@ -328,11 +344,10 @@ class FamilyGroup: self.doc.end_cell() self.doc.end_row() - m = family.getMarriage() if index == families: - self.dump_child_event('TextChild2','Married',m) + self.dump_child_event('TextChild2',_("Married"),m) else: - self.dump_child_event('TextChild1','Death',m) + self.dump_child_event('TextChild1',_("Married"),m) #-------------------------------------------------------------------- # @@ -353,7 +368,7 @@ class FamilyGroup: self.doc.start_row() self.doc.start_cell('ParentHead',4) self.doc.start_paragraph('ParentName') - self.doc.write_text('Children') + self.doc.write_text(_("Children")) self.doc.end_paragraph() self.doc.end_cell() self.doc.end_row() @@ -388,7 +403,10 @@ def report(database,person): family_list = person.getFamilyList() label = topDialog.get_widget("labelTitle") - label.set_text("Family Group chart for " + name) + if no_pdf == 1: + topDialog.get_widget("pdf").set_sensitive(0) + + label.set_text(_("Family Group chart for %s") % name) topDialog.signal_autoconnect({ "destroy_passed_object" : utils.destroy_passed_object, "on_save_clicked" : on_save_clicked, @@ -400,7 +418,7 @@ def report(database,person): frame = topDialog.get_widget("spouse") option_menu = topDialog.get_widget("spouse_menu") - + if len(family_list) > 1: frame.show() else: @@ -449,8 +467,10 @@ def on_save_clicked(obj): if topDialog.get_widget("html").get_active(): template = topDialog.get_widget("htmlfile").get_text() doc = HtmlDoc(template) - else: + elif topDialog.get_widget("openoffice").get_active(): doc = OpenOfficeDoc(paper,orien) + else: + doc = PdfDoc(paper,orien) MyReport = FamilyGroup(db,family,outputName,doc) @@ -465,9 +485,10 @@ def on_save_clicked(obj): # #------------------------------------------------------------------------ def get_description(): - return "Creates a family group report, showing information on "\ - "a set of parents and their children." - + return _("Creates a family group report, showing information on a set of parents and their children.") + +def get_name(): + return _("Generate files/Family Group Report") diff --git a/gramps/src/plugins/GraphViz.py b/gramps/src/plugins/GraphViz.py index 9beb34a4d..a5e0afc44 100644 --- a/gramps/src/plugins/GraphViz.py +++ b/gramps/src/plugins/GraphViz.py @@ -26,6 +26,9 @@ import re import sort import string import utils +import intl + +_ = intl.gettext from gtk import * from gnome.ui import * @@ -238,10 +241,11 @@ def dump_index(person_list,file): # #------------------------------------------------------------------------ def get_description(): - return "Generates relationship graphs, currently only in GraphVis " \ - "format. GraphViz (dot) will transform the graph into "\ - "postscript, jpeg, png, vrml, svg, and many other formats. "\ - "GraphViz is a research project from former AT&T Research Labs. "\ - "For more information or to get a copy of GraphViz, goto "\ - "http://www.graphviz.org" - + return _("Generates relationship graphs, currently only in GraphVis format.") + \ + " " + \ + _("GraphViz (dot) will transform the graph into postscript, jpeg, png, vrml, svg, and many other formats.") + \ + " " + \ + _("For more information or to get a copy of GraphViz, goto http://www.graphviz.org") + +def get_name(): + return _("Generate files/Relationship graph") diff --git a/gramps/src/plugins/HtmlReport.py b/gramps/src/plugins/HtmlReport.py index 1fd0b1ead..ab5d4cac9 100644 --- a/gramps/src/plugins/HtmlReport.py +++ b/gramps/src/plugins/HtmlReport.py @@ -23,6 +23,8 @@ from RelLib import * import const import utils +import intl +_ = intl.gettext import os import re @@ -144,12 +146,12 @@ def an_des_of_gparents_filter(database,person,list): #------------------------------------------------------------------------ filter_map = { - "Individual" : individual_filter, - "Ancestors" : ancestor_filter, - "Descendants" : descendant_filter, - "Ancestors and descendants" : an_des_filter, - "Grandparent's ancestors and descendants" : an_des_of_gparents_filter, - "Entire database" : entire_db_filter + _("Individual") : individual_filter, + _("Ancestors") : ancestor_filter, + _("Descendants") : descendant_filter, + _("Ancestors and descendants") : an_des_filter, + _("Grandparent's ancestors and descendants") : an_des_of_gparents_filter, + _("Entire database") : entire_db_filter } #------------------------------------------------------------------------- @@ -261,19 +263,19 @@ def on_ok_clicked(obj): elif not os.path.isdir(directoryName): parent_dir = os.path.dirname(directoryName) if not os.path.isdir(parent_dir): - GnomeErrorDialog("Neither " + directoryName + " nor " + \ - parent_dir + " are directories") + GnomeErrorDialog(_("Neither %s nor %s are directories") % \ + (directoryName,parent_dir)) return else: try: - print "trying to make",directoryName os.mkdir(directoryName) except IOError, value: - GnomeErrorDialog("Could not create the directory " + directoryName + "\n" + \ - value[1]) + GnomeErrorDialog(_("Could not create the directory : %s") % \ + directoryName + "\n" + value[1]) return except: - GnomeErrorDialog("Could not create the directory " + directoryName) + GnomeErrorDialog(_("Could not create the directory : %s") % \ + directoryName) return if templateName == None: @@ -282,11 +284,11 @@ def on_ok_clicked(obj): try: templateFile = open(templateName,"r") except IOError, value: - GnomeErrorDialog("Could not open the template file (" + templateName + ")\n" + \ - value[1]) + GnomeErrorDialog(_("Could not open the template file (%s)") % templateName + \ + "\n" + value[1]) return except: - GnomeErrorDialog("Could not open the template file (" + templateName + ")") + GnomeErrorDialog(_("Could not open the template file (%s)") % templateName) return top_add = 1 @@ -351,9 +353,9 @@ def print_event(html,name,event): html.write("

%s

\n" % name) html.write("\n") #------------------------------------------------------------------------ @@ -401,7 +403,8 @@ def dump_person(person,prefix,templateTop,templateBottom,targetDir): regex_match = titleRe.search(line) if regex_match != None: - html.write("Family Tree - %s\n" % name ) + txt = _("Family Tree") + html.write("%s - %s\n" % (txt,name) ) html.write("

%s

\n" % person.getPrimaryName().getRegularName()) @@ -424,12 +427,12 @@ def dump_person(person,prefix,templateTop,templateBottom,targetDir): html.write('" WIDTH="' + str(width) + '" HEIGHT="200">\n') if not alive: - print_event(html,"Birth",person.getBirth()) - print_event(html,"Death",person.getDeath()) + print_event(html,_("Birth"),person.getBirth()) + print_event(html,_("Death"),person.getDeath()) family = person.getMainFamily() if family != None: - html.write("

Parents

\n") + html.write("

%s

\n" % _("Parents")) html.write("