4934: try to properly return translation for objclass

svn: r17613
This commit is contained in:
Jérôme Rapinat 2011-05-29 10:34:35 +00:00
parent aec3829a29
commit 70d5094b45
3 changed files with 19 additions and 19 deletions

View File

@ -50,7 +50,7 @@ import DateHandler
import GrampsDisplay
import ManagedWindow
from gen.ggettext import sgettext as _
from TransUtils import trans_see_details
from TransUtils import trans_objclass
from constfunc import mac
from glade import Glade
from DdTargets import DdTargets
@ -1326,13 +1326,13 @@ class MultiTreeView(gtk.TreeView):
objclass, handle = None, None
if objclass in ['Person', 'Event', 'Media', 'Source',
'Repository', 'Family', 'Note', 'Place']:
menu_item = gtk.MenuItem(trans_see_details(objclass))
menu_item = gtk.MenuItem(_("See %s details") % trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.edit_obj(objclass, handle))
popup.append(menu_item)
menu_item.show()
# ---------------------------
menu_item = gtk.MenuItem(_("Make Active %s") % objclass)
menu_item = gtk.MenuItem(_("Make %s Active") % trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.uistate.set_active(handle, objclass))
popup.append(menu_item)
@ -1348,7 +1348,7 @@ class MultiTreeView(gtk.TreeView):
obj = self.dbstate.db.get_table_metadata(objclass)["handle_func"](my_handle)
if obj:
gids.add(obj.gramps_id)
menu_item = gtk.MenuItem(_("Create Filter from selected %s...") % objclass)
menu_item = gtk.MenuItem(_("Create Filter from %s selected...") % trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: make_filter(self.dbstate, self.uistate,
objclass, gids, title=self.title))

View File

@ -26,7 +26,7 @@ Provide a simplified table creation interface
import cgi
import copy
from gen.ggettext import gettext as _
from TransUtils import trans_see_details
from TransUtils import trans_objclass
import cPickle as pickle
import gen.lib
@ -130,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(trans_see_details(objclass))
menu_item = gtk.MenuItem(_("See %s details") % trans_objclass(objclass))
menu_item.connect("activate",
lambda widget: self.on_table_doubleclick(treeview))
popup.append(menu_item)
@ -140,7 +140,7 @@ class SimpleTable(object):
(index is not None and self.__link[index])):
objclass, handle = self.__link[index]
if objclass == 'Person':
menu_item = gtk.MenuItem(_("Make Active Person"))
menu_item = gtk.MenuItem(_("Make %s Active") % trans_objclass('Person'))
menu_item.connect("activate",
lambda widget: self.on_table_click(treeview))
popup.append(menu_item)

View File

@ -289,30 +289,30 @@ def get_available_translations():
return languages
def trans_see_details(objclass_str):
def trans_objclass(objclass_str):
"""
Translates objclass_str into "See %s details", where objclass_str
Translates objclass_str into "... %s", where objclass_str
is 'Person', 'person', 'Family', 'family', etc.
"""
from gen.ggettext import gettext as _
objclass = objclass_str.lower()
if objclass == "person":
return _("See person details")
return _("the person")
elif objclass == "family":
return _("See family details")
return _("the family")
elif objclass == "place":
return _("See place details")
return _("the place")
elif objclass == "event":
return _("See event details")
return _("the event")
elif objclass == "repository":
return _("See repository details")
return _("the repository")
elif objclass == "note":
return _("See note details")
return _("the note")
elif objclass in ["media", "mediaobject"]:
return _("See media details")
return _("the media")
elif objclass == "source":
return _("See source details")
return _("the source")
elif objclass == "filter":
return _("See filter details")
return _("the filter")
else:
return _("See details")