From e795d5e7f87178415f8e6bd2e466523fd9351011 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 9 May 2013 17:04:31 +0000 Subject: [PATCH] enable deferred translation for this Span representation svn: r22215 --- gramps/plugins/lib/libnarrate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/lib/libnarrate.py b/gramps/plugins/lib/libnarrate.py index cb6a57526..18e25dab4 100644 --- a/gramps/plugins/lib/libnarrate.py +++ b/gramps/plugins/lib/libnarrate.py @@ -2,11 +2,12 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2009 Brian G. Matherly +# Copyright (C) 2009 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # Copyright (C) 2011 Vlada Perić # Copyright (C) 2011 Matt Keenan # Copyright (C) 2011 Tim G L Lyons +# Copyright (C) 2013 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -72,6 +73,8 @@ def _get_empty_endnote_numbers(obj): return "" # avoid normal translation! +# enable deferred translations (see Python docs 22.1.3.4) +# (these days this is done elsewhere as _T_ but it was done here first) ##from gramps.gen.const import GRAMPS_LOCALE as glocale ##_ = glocale.translation.gettext def _(message): return message @@ -1391,6 +1394,7 @@ class Narrator(object): locale = glocale self.__translate_text = locale.translation.gettext self.__get_date = locale.get_date + self._locale = locale def set_subject(self, person): """ @@ -2244,7 +2248,7 @@ class Narrator(object): span = death - birth if span and span.is_valid(): if span: - age = span + age = span.get_repr(dlocale=self._locale) age_index = _AGE_INDEX else: age = 0