Added a translation function for 'See %s details'
svn: r17583
This commit is contained in:
parent
188acd427b
commit
9a46bb5792
@ -50,6 +50,7 @@ import DateHandler
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
from gen.ggettext import sgettext as _
|
||||
from TransUtils import trans_see_details
|
||||
from constfunc import mac
|
||||
from glade import Glade
|
||||
from DdTargets import DdTargets
|
||||
@ -1325,7 +1326,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
objclass, handle = None, None
|
||||
if objclass in ['Person', 'Event', 'Media', 'Source',
|
||||
'Repository', 'Family', 'Note', 'Place']:
|
||||
menu_item = gtk.MenuItem(_("See %s details") % objclass)
|
||||
menu_item = gtk.MenuItem(trans_see_details(objclass))
|
||||
menu_item.connect("activate",
|
||||
lambda widget: self.edit_obj(objclass, handle))
|
||||
popup.append(menu_item)
|
||||
|
@ -26,6 +26,7 @@ Provide a simplified table creation interface
|
||||
import cgi
|
||||
import copy
|
||||
from gen.ggettext import gettext as _
|
||||
from TransUtils import trans_see_details
|
||||
import cPickle as pickle
|
||||
|
||||
import gen.lib
|
||||
@ -129,7 +130,7 @@ class SimpleTable(object):
|
||||
if (index is not None and self.__link[index]):
|
||||
# See details (edit, etc):
|
||||
objclass, handle = self.__link[index]
|
||||
menu_item = gtk.MenuItem(_("See %s details") % objclass)
|
||||
menu_item = gtk.MenuItem(trans_see_details(objclass))
|
||||
menu_item.connect("activate",
|
||||
lambda widget: self.on_table_doubleclick(treeview))
|
||||
popup.append(menu_item)
|
||||
|
@ -288,3 +288,30 @@ def get_available_translations():
|
||||
languages.sort()
|
||||
|
||||
return languages
|
||||
|
||||
def trans_see_details(objclass_str):
|
||||
"""
|
||||
Translates objclass_str into "See %s details", where objclass_str
|
||||
is 'Person', 'person', 'Family', 'family', etc.
|
||||
"""
|
||||
objclass = objclass_str.lower()
|
||||
if objclass == "person":
|
||||
return _("See person details")
|
||||
elif objclass == "family":
|
||||
return _("See family details")
|
||||
elif objclass == "place":
|
||||
return _("See place details")
|
||||
elif objclass == "event":
|
||||
return _("See event details")
|
||||
elif objclass == "repository":
|
||||
return _("See repository details")
|
||||
elif objclass == "note":
|
||||
return _("See note details")
|
||||
elif objclass in ["media", "mediaobject"]:
|
||||
return _("See media details")
|
||||
elif objclass == "source":
|
||||
return _("See source details")
|
||||
elif objclass == "filter":
|
||||
return _("See filter details")
|
||||
else:
|
||||
return _("See details")
|
||||
|
Loading…
Reference in New Issue
Block a user