From 8379e0ce6eb5cc668d97275edb95451bc0173726 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 14 Apr 2017 13:54:24 -0700 Subject: [PATCH] add the date-format option to some more reports --- gramps/gen/plug/report/_reportbase.py | 5 ++--- gramps/plugins/drawreport/ancestortree.py | 8 +++++--- gramps/plugins/drawreport/calendarreport.py | 2 +- gramps/plugins/drawreport/descendtree.py | 8 +++++--- gramps/plugins/drawreport/fanchart.py | 5 ++--- gramps/plugins/drawreport/statisticschart.py | 12 ++++++------ gramps/plugins/drawreport/timeline.py | 8 ++++---- gramps/plugins/graph/gvfamilylines.py | 9 ++++++--- gramps/plugins/graph/gvhourglass.py | 11 +++++++---- gramps/plugins/graph/gvrelgraph.py | 9 ++++++--- gramps/plugins/lib/libsubstkeyword.py | 1 - gramps/plugins/textreport/ancestorreport.py | 13 ++++++++----- gramps/plugins/textreport/birthdayreport.py | 3 +-- gramps/plugins/textreport/descendreport.py | 9 ++++++--- gramps/plugins/textreport/detancestralreport.py | 9 ++++++--- gramps/plugins/textreport/detdescendantreport.py | 8 ++++++-- gramps/plugins/textreport/endoflinereport.py | 11 +++++++---- gramps/plugins/textreport/familygroup.py | 9 ++++++--- gramps/plugins/textreport/indivcomplete.py | 3 +-- gramps/plugins/textreport/kinshipreport.py | 13 ++++++++----- .../plugins/textreport/numberofancestorsreport.py | 3 +-- gramps/plugins/textreport/placereport.py | 12 ++++++++---- gramps/plugins/textreport/recordsreport.py | 3 +-- gramps/plugins/textreport/summary.py | 5 ++--- gramps/plugins/textreport/tagreport.py | 12 ++++++++---- 25 files changed, 113 insertions(+), 78 deletions(-) diff --git a/gramps/gen/plug/report/_reportbase.py b/gramps/gen/plug/report/_reportbase.py index b0b59129b..962e1b4d1 100644 --- a/gramps/gen/plug/report/_reportbase.py +++ b/gramps/gen/plug/report/_reportbase.py @@ -69,9 +69,7 @@ class Report: stdoptions.add_localization_option(). """ from ...datehandler import LANG_TO_DISPLAY, main_locale - if language == GrampsLocale.DEFAULT_TRANSLATION_STR: - language = None - if language is None: # the UI language + if language == GrampsLocale.DEFAULT_TRANSLATION_STR: # the UI language locale = glocale elif language in LANG_TO_DISPLAY: # a displayer exists locale = LANG_TO_DISPLAY[main_locale[language]]._locale @@ -85,6 +83,7 @@ class Report: self._name_display.set_name_format(self.database.name_formats) fmt_default = config.get('preferences.name-format') self._name_display.set_default_format(fmt_default) + self._locale = locale # define it here rather than in every report return locale def write_report(self): diff --git a/gramps/plugins/drawreport/ancestortree.py b/gramps/plugins/drawreport/ancestortree.py index c3fab5d78..f22369f00 100644 --- a/gramps/plugins/drawreport/ancestortree.py +++ b/gramps/plugins/drawreport/ancestortree.py @@ -556,8 +556,8 @@ class AncestorTree(Report): self.options = options self._user = user - lang = options.menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) + stdoptions.run_date_format_option(self, options.menu) stdoptions.run_private_data_option(self, options.menu) stdoptions.run_living_people_option(self, options.menu, self._locale) self.database = CacheProxyDb(self.database) @@ -901,7 +901,9 @@ class AncestorTreeOptions(MenuReportOptions): stdoptions.add_private_data_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) ################## category_name = _("Display") diff --git a/gramps/plugins/drawreport/calendarreport.py b/gramps/plugins/drawreport/calendarreport.py index 89cd9e821..75aaca96e 100644 --- a/gramps/plugins/drawreport/calendarreport.py +++ b/gramps/plugins/drawreport/calendarreport.py @@ -112,7 +112,7 @@ class Calendar(Report): if (self.center_person == None) : raise ReportError(_("Person %s is not in the Database") % pid ) - self._locale = self.set_locale(get_value('trans')) + self.set_locale(get_value('trans')) def get_name(self, person, maiden_name = None): """ Return person's name, unless maiden_name given, diff --git a/gramps/plugins/drawreport/descendtree.py b/gramps/plugins/drawreport/descendtree.py index 73436eeb5..2414ff18c 100644 --- a/gramps/plugins/drawreport/descendtree.py +++ b/gramps/plugins/drawreport/descendtree.py @@ -1291,8 +1291,8 @@ class DescendTree(Report): self.options = options - lang = options.menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) + stdoptions.run_date_format_option(self, options.menu) stdoptions.run_private_data_option(self, options.menu) stdoptions.run_living_people_option(self, options.menu, self._locale) self.database = CacheProxyDb(self.database) @@ -1637,7 +1637,9 @@ class DescendTreeOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) ################## category_name = _("Display") diff --git a/gramps/plugins/drawreport/fanchart.py b/gramps/plugins/drawreport/fanchart.py index 0d99437f4..3e122890b 100644 --- a/gramps/plugins/drawreport/fanchart.py +++ b/gramps/plugins/drawreport/fanchart.py @@ -176,11 +176,10 @@ class FanChart(Report): menu = options.menu - lang = options.menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_private_data_option(self, menu) - stdoptions.run_living_people_option(self, menu, rlocale) + stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self.max_generations = menu.get_option_by_name('maxgen').get_value() diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py index 45069571e..63696e478 100644 --- a/gramps/plugins/drawreport/statisticschart.py +++ b/gramps/plugins/drawreport/statisticschart.py @@ -740,13 +740,13 @@ class StatisticsChart(Report): menu = options.menu self._user = user - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) # override default gettext, or English output will have "person|Title" - self._ = rlocale.translation.sgettext + self._ = self._locale.translation.sgettext stdoptions.run_private_data_option(self, menu) - living_opt = stdoptions.run_living_people_option(self, menu, rlocale) + living_opt = stdoptions.run_living_people_option(self, menu, + self._locale) self.database = CacheProxyDb(self.database) get_option_by_name = menu.get_option_by_name @@ -754,7 +754,7 @@ class StatisticsChart(Report): filter_opt = get_option_by_name('filter') self.filter = filter_opt.get_filter() - self.fil_name = "(%s)" % self.filter.get_name(rlocale) + self.fil_name = "(%s)" % self.filter.get_name(self._locale) self.bar_items = get_value('bar_items') year_from = get_value('year_from') @@ -805,7 +805,7 @@ class StatisticsChart(Report): gender, year_from, year_to, get_value('no_years'), self._user.step_progress, - rlocale) + self._locale) self._user.end_progress() self._user.begin_progress(_('Statistics Charts'), diff --git a/gramps/plugins/drawreport/timeline.py b/gramps/plugins/drawreport/timeline.py index f8335da25..27764f163 100644 --- a/gramps/plugins/drawreport/timeline.py +++ b/gramps/plugins/drawreport/timeline.py @@ -99,15 +99,15 @@ class TimeLine(Report): self._user = user menu = options.menu - lang = options.menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_private_data_option(self, menu) - living_opt = stdoptions.run_living_people_option(self, menu, rlocale) + living_opt = stdoptions.run_living_people_option(self, menu, + self._locale) self.database = CacheProxyDb(self.database) self.filter = menu.get_option_by_name('filter').get_filter() - self.fil_name = "(%s)" % self.filter.get_name(rlocale) + self.fil_name = "(%s)" % self.filter.get_name(self._locale) living_value = menu.get_option_by_name('living_people').get_value() for (value, description) in living_opt.get_items(xml_items=True): diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py index 110fc174b..035cf1879 100644 --- a/gramps/plugins/graph/gvfamilylines.py +++ b/gramps/plugins/graph/gvfamilylines.py @@ -174,7 +174,9 @@ class FamilyLinesOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) # -------------------------------- add_option = partial(menu.add_option, _('People of Interest')) @@ -344,8 +346,9 @@ class FamilyLinesReport(Report): get_option_by_name = menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) diff --git a/gramps/plugins/graph/gvhourglass.py b/gramps/plugins/graph/gvhourglass.py index 2207ab75b..4e70392df 100644 --- a/gramps/plugins/graph/gvhourglass.py +++ b/gramps/plugins/graph/gvhourglass.py @@ -85,11 +85,12 @@ class HourGlassReport(Report): Report.__init__(self, database, options, user) menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - stdoptions.run_living_people_option(self, menu, locale) + stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self.__db = self.database @@ -359,7 +360,9 @@ class HourGlassOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) ################################ category_name = _("Graph Style") diff --git a/gramps/plugins/graph/gvrelgraph.py b/gramps/plugins/graph/gvrelgraph.py index 280998551..757e71284 100644 --- a/gramps/plugins/graph/gvrelgraph.py +++ b/gramps/plugins/graph/gvrelgraph.py @@ -128,8 +128,9 @@ class RelGraphReport(Report): get_option_by_name = options.menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) @@ -800,7 +801,9 @@ class RelGraphOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) ################################ add_option = partial(menu.add_option, _("Include")) diff --git a/gramps/plugins/lib/libsubstkeyword.py b/gramps/plugins/lib/libsubstkeyword.py index 157301a8e..b3f9c6d9d 100644 --- a/gramps/plugins/lib/libsubstkeyword.py +++ b/gramps/plugins/lib/libsubstkeyword.py @@ -309,7 +309,6 @@ class DateFormat(GenericFormat): def modifier(): #ui_mods taken from date.py def lookup_modifier(self, modifier): # trans_text is a defined keyword (in po/update_po.py, po/genpot.sh) - # (in po/update_po.py, po/genpot.sh) trans_text = self._locale.translation.gettext ui_mods = ["", trans_text("before"), trans_text("after"), trans_text("about"), "", "", ""] diff --git a/gramps/plugins/textreport/ancestorreport.py b/gramps/plugins/textreport/ancestorreport.py index c436e6ea5..2b7d3c733 100644 --- a/gramps/plugins/textreport/ancestorreport.py +++ b/gramps/plugins/textreport/ancestorreport.py @@ -96,11 +96,12 @@ class AncestorReport(Report): self.map = {} menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - stdoptions.run_living_people_option(self, menu, rlocale) + stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self.max_generations = menu.get_option_by_name('maxgen').get_value() @@ -114,7 +115,7 @@ class AncestorReport(Report): stdoptions.run_name_format_option(self, menu) self.__narrator = Narrator(self.database, use_fulldate=True, - nlocale=rlocale) + nlocale=self._locale) def apply_filter(self, person_handle, index, generation=1): """ @@ -305,7 +306,9 @@ class AncestorOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """ diff --git a/gramps/plugins/textreport/birthdayreport.py b/gramps/plugins/textreport/birthdayreport.py index a8e5a9e82..fe41ae435 100644 --- a/gramps/plugins/textreport/birthdayreport.py +++ b/gramps/plugins/textreport/birthdayreport.py @@ -102,8 +102,7 @@ class BirthdayReport(Report): self.filter = self.filter_option.get_filter() pid = mgobn('pid') - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) stdoptions.run_name_format_option(self, menu) diff --git a/gramps/plugins/textreport/descendreport.py b/gramps/plugins/textreport/descendreport.py index 459dac668..5965846cd 100644 --- a/gramps/plugins/textreport/descendreport.py +++ b/gramps/plugins/textreport/descendreport.py @@ -426,8 +426,9 @@ class DescendantReport(Report): menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) @@ -544,7 +545,9 @@ class DescendantOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """Make the default output style for the Descendant Report.""" diff --git a/gramps/plugins/textreport/detancestralreport.py b/gramps/plugins/textreport/detancestralreport.py index 6dd5b2378..57be77c8f 100644 --- a/gramps/plugins/textreport/detancestralreport.py +++ b/gramps/plugins/textreport/detancestralreport.py @@ -124,8 +124,9 @@ class DetAncestorReport(Report): get_option_by_name = menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) @@ -839,7 +840,9 @@ class DetAncestorOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category) - stdoptions.add_localization_option(menu, category) + locale_opt = stdoptions.add_localization_option(menu, category) + + stdoptions.add_date_format_option(menu, category, locale_opt) # Content options diff --git a/gramps/plugins/textreport/detdescendantreport.py b/gramps/plugins/textreport/detdescendantreport.py index ba285545f..17af6dad4 100644 --- a/gramps/plugins/textreport/detdescendantreport.py +++ b/gramps/plugins/textreport/detdescendantreport.py @@ -140,7 +140,9 @@ class DetDescendantReport(Report): get_option_by_name = menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() - self._locale = self.set_locale(get_value('trans')) + self.set_locale(get_value('trans')) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) @@ -1044,7 +1046,9 @@ class DetDescendantOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category) - stdoptions.add_localization_option(menu, category) + locale_opt = stdoptions.add_localization_option(menu, category) + + stdoptions.add_date_format_option(menu, category, locale_opt) # Content diff --git a/gramps/plugins/textreport/endoflinereport.py b/gramps/plugins/textreport/endoflinereport.py index 6394f50fc..5e007ca21 100644 --- a/gramps/plugins/textreport/endoflinereport.py +++ b/gramps/plugins/textreport/endoflinereport.py @@ -77,11 +77,12 @@ class EndOfLineReport(Report): menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - stdoptions.run_living_people_option(self, menu, rlocale) + stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) pid = menu.get_option_by_name('pid').get_value() @@ -278,7 +279,9 @@ class EndOfLineOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """Make the default output style for the End of Line Report.""" diff --git a/gramps/plugins/textreport/familygroup.py b/gramps/plugins/textreport/familygroup.py index efeb54c42..7aaee3317 100644 --- a/gramps/plugins/textreport/familygroup.py +++ b/gramps/plugins/textreport/familygroup.py @@ -86,10 +86,11 @@ class FamilyGroup(Report): self._user = user menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) self._ = self._locale.translation.sgettext # needed for English + stdoptions.run_date_format_option(self, menu) + stdoptions.run_private_data_option(self, menu) stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) @@ -734,7 +735,9 @@ class FamilyGroupOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) ########################## add_option = partial(menu.add_option, _("Include")) diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py index c7382db51..2ea91b761 100644 --- a/gramps/plugins/textreport/indivcomplete.py +++ b/gramps/plugins/textreport/indivcomplete.py @@ -128,8 +128,7 @@ class IndivCompleteReport(Report): self._user = user menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, menu) diff --git a/gramps/plugins/textreport/kinshipreport.py b/gramps/plugins/textreport/kinshipreport.py index ec45008f6..18c0287ed 100644 --- a/gramps/plugins/textreport/kinshipreport.py +++ b/gramps/plugins/textreport/kinshipreport.py @@ -86,11 +86,12 @@ class KinshipReport(Report): Report.__init__(self, database, options, user) menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - stdoptions.run_living_people_option(self, menu, rlocale) + stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self.__db = self.database @@ -107,7 +108,7 @@ class KinshipReport(Report): stdoptions.run_name_format_option(self, menu) self.rel_calc = get_relationship_calculator(reinit=True, - clocale=rlocale) + clocale=self._locale) self.kinship_map = {} self.spouse_map = {} @@ -386,7 +387,9 @@ class KinshipOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """Make the default output style for the Kinship Report.""" diff --git a/gramps/plugins/textreport/numberofancestorsreport.py b/gramps/plugins/textreport/numberofancestorsreport.py index 5b5457fd0..0b76b2916 100644 --- a/gramps/plugins/textreport/numberofancestorsreport.py +++ b/gramps/plugins/textreport/numberofancestorsreport.py @@ -83,8 +83,7 @@ class NumberOfAncestorsReport(Report): if self.__person is None: raise ReportError(_("Person %s is not in the Database") % pid) - lang = options.menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_name_format_option(self, options.menu) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index e9f75f05b..ee725f1ce 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -81,11 +81,13 @@ class PlaceReport(Report): self._user = user menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - living_opt = stdoptions.run_living_people_option(self, menu, rlocale) + living_opt = stdoptions.run_living_people_option(self, menu, + self._locale) self.database = CacheProxyDb(self.database) self._db = self.database @@ -461,7 +463,9 @@ class PlaceOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """ diff --git a/gramps/plugins/textreport/recordsreport.py b/gramps/plugins/textreport/recordsreport.py index b186c8b9c..0e4785553 100644 --- a/gramps/plugins/textreport/recordsreport.py +++ b/gramps/plugins/textreport/recordsreport.py @@ -75,8 +75,7 @@ class RecordsReport(Report): Report.__init__(self, database, options, user) menu = options.menu - lang = options.menu.get_option_by_name('trans').get_value() - self._locale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_private_data_option(self, menu) living_opt = stdoptions.run_living_people_option(self, menu, diff --git a/gramps/plugins/textreport/summary.py b/gramps/plugins/textreport/summary.py index 5eb2852e2..dd8a7b3cb 100644 --- a/gramps/plugins/textreport/summary.py +++ b/gramps/plugins/textreport/summary.py @@ -75,11 +75,10 @@ class SummaryReport(Report): """ Report.__init__(self, database, options, user) - lang = options.menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_private_data_option(self, options.menu) - stdoptions.run_living_people_option(self, options.menu, rlocale) + stdoptions.run_living_people_option(self, options.menu, self._locale) self.database = CacheProxyDb(self.database) self.__db = self.database diff --git a/gramps/plugins/textreport/tagreport.py b/gramps/plugins/textreport/tagreport.py index b01e15bd0..e763c8e10 100644 --- a/gramps/plugins/textreport/tagreport.py +++ b/gramps/plugins/textreport/tagreport.py @@ -83,11 +83,13 @@ class TagReport(Report): Report.__init__(self, database, options, user) menu = options.menu - lang = menu.get_option_by_name('trans').get_value() - rlocale = self.set_locale(lang) + self.set_locale(menu.get_option_by_name('trans').get_value()) + + stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) - living_opt = stdoptions.run_living_people_option(self, menu, rlocale) + living_opt = stdoptions.run_living_people_option(self, menu, + self._locale) self.database = CacheProxyDb(self.database) self._lv = menu.get_option_by_name('living_people').get_value() @@ -915,7 +917,9 @@ class TagOptions(MenuReportOptions): stdoptions.add_living_people_option(menu, category_name) - stdoptions.add_localization_option(menu, category_name) + locale_opt = stdoptions.add_localization_option(menu, category_name) + + stdoptions.add_date_format_option(menu, category_name, locale_opt) def make_default_style(self, default_style): """Make the default output style for the Tag Report."""