add Gramps type name on translator class

svn: r16113
This commit is contained in:
Jérôme Rapinat
2010-11-02 15:05:51 +00:00
parent bf042a6934
commit 2c37a2c7bb
3 changed files with 30 additions and 11 deletions

View File

@@ -40,6 +40,7 @@ _ = gettext.gettext
import TransUtils
import DateHandler
import config
from gen.lib.grampstype import GrampsType
#------------------------------------------------------------------------
#
@@ -221,3 +222,14 @@ class Translator:
:rtype: unicode
"""
return self.__dd.display(date)
def get_type(self, name):
"""
Return a string representing the name appropriate for the language being
translated.
:param name: The name type to be represented.
:returns: The name as text in the proper language.
:rtype: unicode
"""
return GrampsType.xml_str(name)