From 6a15e552ef13ce5da1ee2c727cbb5763a33fdec2 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Wed, 1 May 2013 17:39:37 +0000 Subject: [PATCH] enable translated output for this report svn: r22136 --- gramps/plugins/graph/gvrelgraph.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gramps/plugins/graph/gvrelgraph.py b/gramps/plugins/graph/gvrelgraph.py index 9ad734aaf..4f6bce270 100644 --- a/gramps/plugins/graph/gvrelgraph.py +++ b/gramps/plugins/graph/gvrelgraph.py @@ -1,11 +1,10 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2007-2008 Brian G. Matherly -# # Adapted from GraphViz.py (now deprecated) # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2005-2006 Eero Tamminen +# Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2007 Johan Gonqvist # Contributions by Lorenzo Cappelletti # Copyright (C) 2008 Stephane Charette @@ -40,8 +39,6 @@ Create a relationship graph using Graphviz # python modules # #------------------------------------------------------------------------ -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.sgettext from functools import partial import copy @@ -50,6 +47,8 @@ import copy # GRAMPS modules # #------------------------------------------------------------------------ +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.sgettext from gramps.gen.constfunc import conv_to_unicode from gramps.gen.plug.menu import (BooleanOption, EnumeratedListOption, FilterOption, PersonOption, ColorOption) @@ -87,7 +86,7 @@ class RelGraphReport(Report): def __init__(self, database, options, user): """ - Create ComprehensiveAncestorsReport object that produces the report. + Create RelGraphReport object that produces the report. The arguments are: @@ -170,6 +169,8 @@ class RelGraphReport(Report): if name_format != 0: self._name_display.set_default_format(name_format) + self.set_locale(menu.get_option_by_name('trans').get_value()) + def write_report(self): self.person_handles = self._filter.apply(self.database, self.database.iter_person_handles()) @@ -369,8 +370,8 @@ class RelGraphReport(Report): if mediaMimeType[0:5] == "image": imagePath = get_thumbnail_path( media_path_full(self.database, - media.get_path()), - rectangle=mediaList[0].get_rectangle()) + media.get_path()), + rectangle=mediaList[0].get_rectangle()) # test if thumbnail actually exists in thumbs # (import of data means media files might not be present imagePath = find_file(imagePath) @@ -462,7 +463,7 @@ class RelGraphReport(Report): if self.just_years: return '%i' % event.get_date_object().get_year() else: - return get_date(event) + return self._get_date(event.get_date_object()) elif self.use_place: place_handle = event.get_place_handle() place = self.database.get_place_from_handle(place_handle) @@ -470,7 +471,6 @@ class RelGraphReport(Report): return place.get_title() return '' - #------------------------------------------------------------------------ # # RelGraphOptions class @@ -555,6 +555,8 @@ class RelGraphOptions(MenuReportOptions): "relative to the name")) add_option("imageOnTheSide", self.__image_on_side) + stdoptions.add_localization_option(menu, category_name) + ################################ add_option = partial(menu.add_option, _("Graph Style")) ################################