4934: try to properly return translation for objclass
svn: r17613
This commit is contained in:
parent
aec3829a29
commit
70d5094b45
@ -50,7 +50,7 @@ import DateHandler
|
|||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from gen.ggettext import sgettext as _
|
from gen.ggettext import sgettext as _
|
||||||
from TransUtils import trans_see_details
|
from TransUtils import trans_objclass
|
||||||
from constfunc import mac
|
from constfunc import mac
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
@ -1326,13 +1326,13 @@ class MultiTreeView(gtk.TreeView):
|
|||||||
objclass, handle = None, None
|
objclass, handle = None, None
|
||||||
if objclass in ['Person', 'Event', 'Media', 'Source',
|
if objclass in ['Person', 'Event', 'Media', 'Source',
|
||||||
'Repository', 'Family', 'Note', 'Place']:
|
'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",
|
menu_item.connect("activate",
|
||||||
lambda widget: self.edit_obj(objclass, handle))
|
lambda widget: self.edit_obj(objclass, handle))
|
||||||
popup.append(menu_item)
|
popup.append(menu_item)
|
||||||
menu_item.show()
|
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",
|
menu_item.connect("activate",
|
||||||
lambda widget: self.uistate.set_active(handle, objclass))
|
lambda widget: self.uistate.set_active(handle, objclass))
|
||||||
popup.append(menu_item)
|
popup.append(menu_item)
|
||||||
@ -1348,7 +1348,7 @@ class MultiTreeView(gtk.TreeView):
|
|||||||
obj = self.dbstate.db.get_table_metadata(objclass)["handle_func"](my_handle)
|
obj = self.dbstate.db.get_table_metadata(objclass)["handle_func"](my_handle)
|
||||||
if obj:
|
if obj:
|
||||||
gids.add(obj.gramps_id)
|
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",
|
menu_item.connect("activate",
|
||||||
lambda widget: make_filter(self.dbstate, self.uistate,
|
lambda widget: make_filter(self.dbstate, self.uistate,
|
||||||
objclass, gids, title=self.title))
|
objclass, gids, title=self.title))
|
||||||
|
@ -26,7 +26,7 @@ Provide a simplified table creation interface
|
|||||||
import cgi
|
import cgi
|
||||||
import copy
|
import copy
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
from TransUtils import trans_see_details
|
from TransUtils import trans_objclass
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
|
|
||||||
import gen.lib
|
import gen.lib
|
||||||
@ -130,7 +130,7 @@ class SimpleTable(object):
|
|||||||
if (index is not None and self.__link[index]):
|
if (index is not None and self.__link[index]):
|
||||||
# See details (edit, etc):
|
# See details (edit, etc):
|
||||||
objclass, handle = self.__link[index]
|
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",
|
menu_item.connect("activate",
|
||||||
lambda widget: self.on_table_doubleclick(treeview))
|
lambda widget: self.on_table_doubleclick(treeview))
|
||||||
popup.append(menu_item)
|
popup.append(menu_item)
|
||||||
@ -140,7 +140,7 @@ class SimpleTable(object):
|
|||||||
(index is not None and self.__link[index])):
|
(index is not None and self.__link[index])):
|
||||||
objclass, handle = self.__link[index]
|
objclass, handle = self.__link[index]
|
||||||
if objclass == 'Person':
|
if objclass == 'Person':
|
||||||
menu_item = gtk.MenuItem(_("Make Active Person"))
|
menu_item = gtk.MenuItem(_("Make %s Active") % trans_objclass('Person'))
|
||||||
menu_item.connect("activate",
|
menu_item.connect("activate",
|
||||||
lambda widget: self.on_table_click(treeview))
|
lambda widget: self.on_table_click(treeview))
|
||||||
popup.append(menu_item)
|
popup.append(menu_item)
|
||||||
|
@ -289,30 +289,30 @@ def get_available_translations():
|
|||||||
|
|
||||||
return languages
|
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.
|
is 'Person', 'person', 'Family', 'family', etc.
|
||||||
"""
|
"""
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
objclass = objclass_str.lower()
|
objclass = objclass_str.lower()
|
||||||
if objclass == "person":
|
if objclass == "person":
|
||||||
return _("See person details")
|
return _("the person")
|
||||||
elif objclass == "family":
|
elif objclass == "family":
|
||||||
return _("See family details")
|
return _("the family")
|
||||||
elif objclass == "place":
|
elif objclass == "place":
|
||||||
return _("See place details")
|
return _("the place")
|
||||||
elif objclass == "event":
|
elif objclass == "event":
|
||||||
return _("See event details")
|
return _("the event")
|
||||||
elif objclass == "repository":
|
elif objclass == "repository":
|
||||||
return _("See repository details")
|
return _("the repository")
|
||||||
elif objclass == "note":
|
elif objclass == "note":
|
||||||
return _("See note details")
|
return _("the note")
|
||||||
elif objclass in ["media", "mediaobject"]:
|
elif objclass in ["media", "mediaobject"]:
|
||||||
return _("See media details")
|
return _("the media")
|
||||||
elif objclass == "source":
|
elif objclass == "source":
|
||||||
return _("See source details")
|
return _("the source")
|
||||||
elif objclass == "filter":
|
elif objclass == "filter":
|
||||||
return _("See filter details")
|
return _("the filter")
|
||||||
else:
|
else:
|
||||||
return _("See details")
|
return _("See details")
|
||||||
|
Loading…
Reference in New Issue
Block a user