From a7bffb9259f293b2dbcd1ae2ec421e453debba01 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 20 Nov 2014 10:05:09 -0800 Subject: [PATCH] 8184: regression: Complete Individual report has some untranslated output --- gramps/gen/lib/eventtype.py | 26 +++++++++++----------- gramps/gen/lib/grampstype.py | 7 ++++++ gramps/plugins/textreport/indivcomplete.py | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/gramps/gen/lib/eventtype.py b/gramps/gen/lib/eventtype.py index 7862694fe..043877a5e 100644 --- a/gramps/gen/lib/eventtype.py +++ b/gramps/gen/lib/eventtype.py @@ -137,25 +137,29 @@ class EventType(GrampsType): RETIREMENT = 43 WILL = 44 - _MENU = [[_('Life Events'), + def _T_(value): # enable deferred translations (see Python docs 22.1.3.4) + return value + # _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh + + _MENU = [[_T_('Life Events'), [BIRTH, BAPTISM, DEATH, BURIAL, CREMATION, ADOPT]], - [_('Family'), + [_T_('Family'), [ENGAGEMENT, MARRIAGE, DIVORCE, ANNULMENT, MARR_SETTL, MARR_LIC, MARR_CONTR, MARR_BANNS, DIV_FILING, MARR_ALT]], - [_('Religious'), + [_T_('Religious'), [CHRISTEN, ADULT_CHRISTEN, CONFIRMATION, FIRST_COMMUN, BLESS, BAR_MITZVAH, BAS_MITZVAH, RELIGION]], - [_('Vocational'), + [_T_('Vocational'), [OCCUPATION, RETIREMENT, ELECTED, MILITARY_SERV, ORDINATION]], - [_('Academic'), + [_T_('Academic'), [EDUCATION, DEGREE, GRADUATION]], - [_('Travel'), + [_T_('Travel'), [EMIGRATION, IMMIGRATION, NATURALIZATION]], - [_('Legal'), + [_T_('Legal'), [PROBATE, WILL]], - [_('Residence'), + [_T_('Residence'), [RESIDENCE, CENSUS, PROPERTY]], - [_('Other'), + [_T_('Other'), [CAUSE_DEATH, MED_INFO, NOB_TITLE, NUM_MARRIAGES]]] _CUSTOM = CUSTOM @@ -210,10 +214,6 @@ class EventType(GrampsType): (MARR_ALT , _("Alternate Marriage"), "Alternate Marriage"), ] - def _T_(value): # enable deferred translations (see Python docs 22.1.3.4) - return value - # _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh - _ABBREVIATIONS = { BIRTH: _T_("birth abbreviation|b."), DEATH: _T_("death abbreviation|d."), diff --git a/gramps/gen/lib/grampstype.py b/gramps/gen/lib/grampstype.py index edee6a303..b0e05389a 100644 --- a/gramps/gen/lib/grampstype.py +++ b/gramps/gen/lib/grampstype.py @@ -289,6 +289,13 @@ class GrampsType(GrampsTypeC): return self._CUSTOM def get_menu(self): + """Return the list of localized names for the menu.""" + if self._MENU: + return [[_(i),s] for (i, s) in self._MENU] + return self._MENU + + def get_menu_standard_xml(self): + """Return the list of XML (english) names for the menu.""" return self._MENU def __eq__(self, value): diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py index 17cb245e3..f261ebc13 100644 --- a/gramps/plugins/textreport/indivcomplete.py +++ b/gramps/plugins/textreport/indivcomplete.py @@ -73,7 +73,7 @@ CUSTOM = _T_("Custom") # Construct section list and type to group map SECTION_LIST = [] TYPE2GROUP = {} -for event_group, type_list in EventType().get_menu(): +for event_group, type_list in EventType().get_menu_standard_xml(): SECTION_LIST.append(event_group) for event_type in type_list: TYPE2GROUP[event_type] = event_group